r/programming • • Jun 25 '15

Atom 1.0

http://blog.atom.io/2015/06/25/atom-1-0.html
1.1k Upvotes

632 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Jun 28 '15

Linking dependencies from a shared global cache is more error prone than duplicating dependencies for each library/application.

Yes it saves you hard drive space and network calls, but ultimately the amount of wasted space and unneeded network calls is trivial.

Duplicating dependencies simplifies things a lot. It means I can edit the libraries I'm using or symlink them to some local repo while I develop and know it'll only affect one application. In my experience, working with dependency managers like pip and bundler (which install dependencies globally) working in a multi application, multi language version environment (e.g. python 2.7.* vs python 3) is a huge headache compared to npm.

1

u/noratat Jun 30 '15 edited Jun 30 '15

Linking dependencies from a shared global cache is more error prone than duplicating dependencies for each library/application.

Sure, in theory. In practice... I've had more problems with npm and it's supposedly safer duplication than any other package manager I've ever used, hands down.

With Gradle specifically: Gradle isn't doing any of this globally. The cache is per-user, includes the gradle distribution itself (via the gradle wrapper), and two projects using different versions will still get whichever version they requested, so the idea of project isolation is still very much intact.

Duplicating dependencies simplifies things a lot.

Let's say I have a library A. I have two packages B and C that both extend the functionality of A, except they depend on different versions of A. This comes up a lot, especially with plugins, and npm ended up implementing peerDependencies as a hacky workaround so they could fake it. I wasn't calling it a graph for performance reasons, I called it a graph because that's what it actually is.

To be fair, even this wouldn't be a big deal, except that the node community plays extremely fast and loose with versioning (despite all the lip service paid to semantic versioning).

Also, while consider it minor compared to the above issues, the performance difference isn't negligible either - on a rebuild with a populated cache, even larger gradle projects take order seconds to validate dependencies and run while npm install often takes order minutes - and I find myself having to do a clean npm install a lot more often than a clean gradle build.

In my experience, working with dependency managers like pip and bundler (which install dependencies globally)

Admittedly I have little experience with pip and bundler (not a fan of pure dynamic languages in general), but I was under the impression this was part of the problem things like virtualenv were supposed to solve?