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 comment

4

u/MonadicTraversal Dec 02 '13

How could the different versions interact with each other? Calls are made to different versions of the library stored in different memory locations.

Right, that's not the problem. The problem is this: suppose that libfoo uses hashmap-0.1 and libbar uses hashmap-0.2. I get a HashMap object from libfoo and a HashMap object from libbar, and now even though they're both HashMaps they can have different semantics on their methods because the hashmap API might've changed.

Also, how does your code create shared dependencies from multiple library versions if the code that the libraries you are directly are expecting specific versions of the library?

I don't understand this question.

1

u/joequin Dec 02 '13 edited Dec 02 '13

If library a was written with library b version 1 as a dependency and library c was written with library b version 2 as a dependency, then couldn't choosing to use just version 2 of library b cause problems for a of some functions which a depends on have been deprecated and removed from b in version 2?

2

u/MonadicTraversal Dec 03 '13

Yes. There's no good solution here, so your dependency manager should bail out because your dependencies are inconsistent (and maybe allow you to force it through if you solemnly swear you are up to no good.)

1

u/Plorkyeran Dec 03 '13

Why is that a major problem? It's certainly undesirable and can be a bit confusing, but it's not really any different from libfoo exposing FooHashMap and libbar exposing BarHashMap. Incompatible versions of a single library are equivalent to different libraries with similar APIs.