5 ms·
One great thing about these new language features is that you don't have to use them. You can run on jdk8 and program as if it was your grandmas vm. This was tr
by larsmak 12y ago
One great thing about these new language features is that you don't have to use them. You can run on jdk8 and program as if it was your grandmas vm. This was true for generics and will be true for lambdas etc. As programmers become more advanced they understand the need for the more advanced features and start to adopt them - but they are not strictly required from the start.
- bad_user 12y agoTo 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 12y agoMy two major complaints with generics in Java is lack of type aliases and the whole issue with primitive types support.
- bad_user 12y agoIn Scala you can specialize for primitives btw. It has some gotchas, but if you know what you're doing, it works OK.
- pjmlp 12y 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.