4 ms·
Can you elaborate on what kind of dependencies should we avoid and why?
by croo 6y ago
Can you elaborate on what kind of dependencies should we avoid and why?
- aprdm 6y agoI would say to think very hard before adding any dependencies! A dependency is code you usually have no control over and has to evolve with your code base during the years. Let's say you're using Python and you depend on library A, if over the years library A is no longer maintained now you need to either own it or drop it. It could for example delay your python 2 -> 3 migration because the author never made it compatible to python3. There are also the transitive dependency, say library B locks to a version of library C that has to be <1.0 and library E wants to use library C >1.0, how do you resolve it? Or library B requires a specific tool chain to be build (say gcc4) but now you want to use gcc6 and it isn't compatible.. (sort of the same example of py 2->3 but for C++)
- tcgv 6y agoIn addition I would add the Dependency Inversion Principle [1] as a valuable tool for managing dependencies, specially for integrating third party code/APIs into the system. It will protect your application by reducing the surface area susceptible to change if/when that dependency needs to be upgraded or replaced. [1] https://en.wikipedia.org/wiki/Dependency_inversion_principle https://en.wikipedia.org/wiki/Dependency_inversion_principle