3 ms·
To be fair, Java's generics are so awfully implemented that I stay away from them as much as I can - i.e. invariant, with use-site variance notations by means o
by bad_user 13y ago
To be fair, Java's generics are so awfully implemented that I stay away from them as much as I can - i.e. invariant, with use-site variance notations by means of existential types and freaking wildcards (instead of declaration-site like how Scala does it, which is much saner).
I mean, take a look at this presentation: http://parleys.com/play/514892250364bc17fc56bb15/chapter0/about http://parleys.com/play/514892250364bc17fc56bb15/chapter0/ab...
And I'm not even ranting about the generics being based on type-erasure, like so many other people are doing. Type-erasure is actually one of the best features of Java, since reification implies doing damage in the runtime which would have impacted other languages and with a good type system, you wouldn't need reification anyway.
- pjmlp 13y agoMy two major complaints with generics in Java is lack of type aliases and the whole issue with primitive types support.
- bad_user 13y agoIn Scala you can specialize for primitives btw. It has some gotchas, but if you know what you're doing, it works OK.
- pjmlp 13y agoThanks for the hint. Actually, in terms of alternative FP JVM languages, I am more into Clojure than Scala, even though I am a big ML fan. So I my Scala knowledge is currently at Scala 2.8 level and I wasn't aware of it.