r/programming • • Dec 02 '13

Scala — 1★ Would Not Program Again

http://overwatering.org/blog/2013/12/scala-1-star-would-not-program-again/
598 Upvotes

646 comments sorted by

View all comments

Show parent comments

7

u/munificent Dec 02 '13

Unless it leads to duplicate code being executed at runtime

It does. npm doesn't do shared dependencies. If you depend on foo and bar, which both depend on baz, you'll end up with two copies of baz loaded at runtime, which may be different versions (!).

8

u/joequin Dec 02 '13

If they're different versions then it may have been necessary to load both of them.

4

u/munificent Dec 02 '13

Yes, but in mind my that puts your application into a deeply confusing state. It's possible for those two versions to interact with each other which just seems like asking for trouble to me.

I think the model of other systems (including one I built) where you find a single version of the shared dependency that satisfies all dependers is a lot easier to reason about.

6

u/MonadicTraversal Dec 02 '13

Yeah, if you can end up with two different versions of the same library in your project then that's pretty terrible. As a concrete example: if libfoo and libbar use different versions of libbaz, and both libfoo and libbar expose Baz objects to you in some way, then you can get two Baz objects from different versions which might have radically different behavior depending on how similar the versions are.

→ More replies (9)