Re:Java Is Underhyped
by yoneda on Friday April 16, 2021 @06:24AM
(#26832027)
I generally agree, except the part about the low risk of runtime surprises. Java's type system is so weak that it doesn't even prevent null from inhabiting almost every type. The programmer is then forced to manually reason about when a value can be null or not, and of course humans can easily make mistakes in doing so. This inevitably leads to NullPointerExceptions at runtime when a project becomes sufficiently complex. Type systems of "low risk" languages prevent such mistakes by offloading this kind of error-prone reasoning from the programmer to the machine.
[ Parent
| on HN ]
> Java's type system is so weak that it doesn't even prevent null from inhabiting almost every type.
"So weak"? You do realize that this is basically where every language was less than a decade ago?
Yes, Java's type system "so weak". Just because many other popular languages have similarly weak type systems doesn't make them less weak. Also, as a long-time Haskell user, I can assure you that nullable types were nothing new even several decades ago. Perhaps you have only worked with object-oriented languages, where nullability is typically the default (which is a bad idea).
Re:Java Is Underhyped
by TheCoelacanth on Friday April 16, 2021 @08:25PM
(#26840524)
There are tons of languages with non-nullable types that are much older than that. C++, basically every ML-influenced language, Prolog, Erlang, Tcl.
A decade ago Idris, Agda, Haskell had been around for a time already, there hasn't been that much advance in 10 years. And a decade ago it was also a commonly argued that Java isn't getting a lot in return for its very basic static types, vs simplcity and expressivity that dynamic languages get.
Re:Java Is Underhyped
by KptMarchewa on Friday April 16, 2021 @08:39AM
(#26833128)
I like Java, but that's weak argument.
We're in 2021, not decade ago.
What language sees wide spread use without at least a decade in gestation? Java, ironically, but cutting edge languages take longer than a decade before making it to the blue collar programmer's floor. I mean the number of people that struggle with even stuff like generics still is amazing and that has been around for 17 years at this point so 10 years is nothing.