![]() ![]() ![]() Maybe you just want to share your own code between two projects - a situation where submodules might offer the simplest possible workflow. Not every piece of code might be available over a package manager.Submodules, on the other hand, always work the same. Especially if you’re working with multiple technologies, each one might have its own package manager with its own set of rules and commands. Submodules provide a consistent, reliable interface - no matter what language or framework you’re using.However, you could argue that Git’s submodule architecture comes with a couple of advantages: You could also use one of the various “package manager” systems that many modern languages and frameworks provide. Luckily, Git’s submodule concept was made for exactly these situations.īut of course, submodules aren’t the only available solution for this kind of problem. And it’s certainly true for managing third-party code in your own projects. The general rule in software development to “keep separate things separate” exists for a reason. Whenever you need to update the library code (because its maintainer delivered a great new feature or fixed a nasty bug) you again have to download, copy, and paste.The line between your own project and that of someone else (the library) starts to get blurry. By brute force copying third-party code into your project, you’re effectively mixing multiple projects into one.While certainly quick, this approach is definitely dirty for a couple of reasons: When you need to include third-party code (such as an open-source library) you can of course go the easy way: just download the code from GitHub and dump it somewhere into your project. To make clear why Git’s submodules are indeed an invaluable structure, let’s look at a case without submodules.
0 Comments
Leave a Reply. |