4 ms·
My main complaint is the treatment of generics and lack of value types, which are actually two sides of the same coin. Another thing I'd like to see is opt-in
by qsort 5y ago
My main complaint is the treatment of generics and lack of value types, which are actually two sides of the same coin.
Another thing I'd like to see is opt-in null safety. The Optional type is a very good mechanism, but when every reference is potentially null, its ability to enhance language safety is limited.
Other than that, it has everything I want. And of course, the ecosystem, tooling, etc. is simply the best in class.
My personal preference is for ML-style languages, so Java will never be my true love. But as far as languages go, you can do much worse.
- knuthsat 5y agoI think there's work being done on value types in Java. Although this was the case 6+ years ago. I'm surprised they still didn't land into Java.
- papercrane 5y agoJEP 169 is for value objects and JEP 218 is for generics over primitives. As the grandparent comment said they go hand-in-hand. My sense is they're more concerned about getting it right then getting it shipped, as both have been in the works for years.
- qsort 5y agoYeah, it doesn't look like Project Valhalla will land before the next LTS. The original separation of primitive types and reference types was necessary when Java was first released, but it's a deal with the devil. It made everything else much harder than it could have been otherwise. Even then we won't have fully reified generics, but some of the stuff they're doing with type projections is insane. I'm pretty sure it's going to be a game changer.
- native_samples 5y agoUse Kotlin to get null safety (and more), plus the ecosystem and tooling.
- qsort 5y agoI haven't found switching to Kotlin to be worthwhile enough to justify moving away from Java, but YMMV. If we're considering other JVM languages, Scala and Clojure are also on the table.