Skip to main content
124 votes

Why prefer a package manager over a library folder?

An important point missing from the other answers: Using a package manager means having a configuration that indicates which library versions you are using and makes sure that config information is ...
sleske's user avatar
  • 10.3k
40 votes

Why prefer a package manager over a library folder?

Pros of lib folder disappear quickly after you move from small scale development to bigger work. For example the "benefit" of not requiring an external tool is trumped by the work required ...
Kayaman's user avatar
  • 1,980
36 votes

Why prefer a package manager over a library folder?

You're missing many of the advantages of package managers. Package managers allow you to avoid checking large (several megabyte or larger) binaries into source control. Doing so is anathema to many ...
jpmc26's user avatar
  • 5,578
16 votes

Why prefer a package manager over a library folder?

Having recently converted our product from using manually downloaded libraries to automatic package management with Nuget, I can say that using a package manager has massive benefits. Our product is ...
17 of 26's user avatar
  • 4,850
16 votes
Accepted

Writing a separate package vs copy pasting small amount of reused code

Isolating the serialization code in its own package is little overhead but significant benefits. You already pointed out the reuse possibility the package, but in fact it offers more: Separation of ...
Christophe's user avatar
  • 82.2k
14 votes

Why prefer a package manager over a library folder?

No need of external tool to manage packages That's kind of a non-point is it? If I use a package manager, I don't need to have a lib folder. I also don't have to manage the packages myself. No ...
Athos vk's user avatar
  • 430
11 votes
Accepted

Adding library as dependency only to use one function

This really really depends and has to be decided on a case by case basis. Also, the modern JavaScript ecosystem has a strong bias towards using tiny libraries, so conventions from other ecosystems do ...
amon's user avatar
  • 136k
10 votes
Accepted

Singleton with dependency injection ,is that a good practice in some cases?

This is problematic, because if your program calls HeavyTaskDb.Instance(X) first, and then HeavyTaskDb.Instance(Y) later (maybe in a completely different area of the code base), it returns ...
Doc Brown's user avatar
  • 220k
9 votes
Accepted

Remove circular dependency

The general problem here is the Event class having too many responsibilities. It should be a dumb information container, maybe with some persistence methods, but not more. Keeping any domain logic out ...
Doc Brown's user avatar
  • 220k
7 votes

How to ensure long-term enterprise software stability with changing frameworks / things going out of support?

The more you leverage Other Peoples Work TM the more your are at the whim of other people. So there are four ways to handle this: Pay a Not Inconsequential Amount of Money to develop and maintain 100%...
Kain0_0's user avatar
  • 16.6k
6 votes

Resolving circular dependency between two classes

The simple solution to this is to recognise that Controller doesn't need a dependency on Messenger, it needs a dependency on send. So provide it with that dependency: interface Sender { void send(...
David Arno's user avatar
  • 39.6k
6 votes
Accepted

Is it a bad idea to model dependencies using a project's directory structure?

This approach is not as good as good as it might appear. Directory structures are not as flexible as programming languages expressivity. Let's look at some problems you have to think of in your ...
Christophe's user avatar
  • 82.2k
6 votes
Accepted

Should we include the entire sources of the libraries used in our project?

Putting the entire source of a library in your project allows you to: Maintain and update the library in the event that it is abandoned. Make alterations to the library to advance goals for your ...
Robert Harvey's user avatar
6 votes
Accepted

Matching dependency versions across multiple Python projects

60 repos containing Python packages I have a few years' experience working with about double that. Different repos had different policies. Many of them would rev independently. Keeping a repo small ...
J_H's user avatar
  • 7,891
5 votes
Accepted

Critical dependency is preventing me from updating my app to latest framework version

Because of reasons like this, dependencies are not just an asset but also a kind of liability: today's rapid development is tomorrows technical debt. Depending on the risks you forsee and want to ...
amon's user avatar
  • 136k
5 votes

Why prefer a package manager over a library folder?

It is the difference between just using libraries (lib directory), and using them, maintaining meta-information (package manager). Such meta-information concerns version numbers, (transitive) ...
Joop Eggen's user avatar
  • 2,639
5 votes
Accepted

Use deprecated library or copy the code I need from it into my codebase?

If you're building something to use longer than a quick throwaway experiment, then it's asking for trouble to depend on deprecated code, esp. open source code whose source is no longer posted online. ...
Jerry101's user avatar
  • 5,477
5 votes
Accepted

Where to put technical updates in git branching flow?

Feature branches are a general term that means "not the main branch" (or master). Don't get too complicated with this. Create a branch just to upgrade that dependency. This should capture ...
Greg Burghardt's user avatar
4 votes

"Crossing Boundaries" in Clean Architecture

First, let me strongly recommend that you read Robert Martin's book titled Clean Architecture if you haven't. I assume that you have read it, but I don't know for sure, because many questions that are ...
Fearnbuster's user avatar
4 votes
Accepted

Avoiding instantiating the whole application at startup when using a composition root

Say I want a timestamp that represents now. I can't create it at startup because at startup nothing knows when now is. I also don't want to hardcode the timestamp because I don't want to be tied to a ...
candied_orange's user avatar
4 votes

Twelve-Factor App: Dependency Managment and binaries

It's about Deployment If your product needs any system dependencies that are not a core component of the operating system, then your product needs to include it as part of the installation package. ...
Berin Loritsch's user avatar
4 votes
Accepted

How should projects that interact with or depend upon external binaries handle version specific failures?

I see two possible solutions. The good one, and the not-so-good one: The good one: those binaries are dependencies and so should be bundled with the project. And in concrete versions. Just like every ...
freakish's user avatar
  • 3,065
4 votes
Accepted

How to deal with conflicting dependencies/versions?

There is no easy solution here. If an incompatible version of a library/library is released, there is little you can do using technology. But I find that kind of situation unlikely. If a plugin or ...
Euphoric's user avatar
  • 38.2k
4 votes

How to manage common library dependencies to prevent cross-application breakage?

Unfortunately, if you make a number of essentially independent codebases dependent on the always-latest version of a common library, then you get two problems. One, is that any change to the common ...
Steve's user avatar
  • 12.6k
3 votes
Accepted

Best practice of c/C++ dependency management on build servers?

Moving third party build dependencies into your repository is perfectly fine, and even has some advantages (eg. no version mismatches, tracked upgrades). But doing so should not touch your code. C/C+...
Alex Reinking's user avatar
3 votes

Critical dependency is preventing me from updating my app to latest framework version

The critical thing to sort out is the nature of your dependency. Does the older version provide one thing that your project needs or many things? Does the newer version provide one thing or many ...
candied_orange's user avatar
3 votes

Why prefer a package manager over a library folder?

There are some cases where a lib folder might be necessary, for example when dealing with obsolete libraries (a version of it no longer maintained/available), a locally modified version of a library, ....
FranMowinckel's user avatar
3 votes

"Crossing Boundaries" in Clean Architecture

Yes, the interactor is injected into the controller. When the application starts, the main module instantiates all application objects (interactors, controllers, views, etc.). In principle, a ...
doubleYou's user avatar
  • 2,867
3 votes

How to ensure long-term enterprise software stability with changing frameworks / things going out of support?

Summary Abstract dependencies that can be reasonably abstracted, so you're prepared for needing to swap them out in the future. If you're relying on vendor support, vet your vendors and take a good ...
Flater's user avatar
  • 59.5k
3 votes
Accepted

Design class with different dependency requirements based on configuration

You've not abstracted this correctly. Inject a dependency (IDependency) which has a method which returns a boolean. Your service does not need to know how the dependency works, it just knows that it ...
Flater's user avatar
  • 59.5k

Only top scored, non community-wiki answers of a minimum length are eligible