Sharing code across apps

We’ve done someting like this at work with a Ruby app. We used a git submodule for the common parts, but eventually realized that we were basically reimplementing a package manager using git.

If I was to do this again, I would first seriously consider keeping everything as one application. If that got ruled out, I would probably make a regular library from the common code, so that it would be managed the same way as all other libraries.

But then it’s important to be very careful about what this common code depends on. Our apps share some dependencies that are really only needed by one of them, but the submodule was pulled out ad hoc without anyone puting in the effort to really make it reusable, so it’s kind of a mess.