3 ms·
Why do you feel that it is a failed experiment? As a user of the collections, it seems to me to work out. Is it more of a problem with the implementation of t
by eeperson 12y ago
Why do you feel that it is a failed experiment? As a user of the collections, it seems to me to work out. Is it more of a problem with the implementation of the collections?
- zak_mc_kracken 12y agoAgreed. There is a vocal minority of people (academics mostly) yelling at how subtype polymorphism is broken and unusable. It certainly has broken aspects (with respect to equality) but by and large, it's extremely usable, intuitive and it enables powerful abstractions. The corner cases where it falls apart seem to be irrelevant for most uses.
- runT1ME 12y agoI should have added that despite me not liking the std lib collections library, it's still stands above all other collection libs I've used in other languages. The problem is that the std. lib collections tries to unify mutable/immutable and lazy/eager/finite/infinte datastructures into one class hierarchy. So you have methods like "size" or "add" on generic interfaces that mean different things depending on the implementation. So the entire abstraction ends up being leaky. Scalaz has a few common implementations of immutable, eager data structures and ends up using a type class approach to modularity and code reuse that ends up not being leaky, it's a joy to use. I don't think there's anything wrong with using the collections, just be aware that if you run into some edge cases, it's not the language, it's design choices made by the library writer and there may be better implementations.