What's the story with nullability in Java these days? I used to be a Java dev, and NullPointerExceptions were a thorn in my side.
Kotlin has (real, language-level) non-nullable references, which strikes me as a big improvement.
Even basic intellij suggestions can save you from most instances of NPEs, but you have the option for complete third-party static analysis (with either default to nullable, or default to non-nullable, and then adding @NonNullable or @Nullable annotation, respectively ). These are not standard annotations, but all third party analyzers do in fact understand each other, and they have the stdlib annotated. Oh and debugging story became much better, you get exact property-access instead of only a line number, but that is a JVM-change not java.
If you do some long, chained property accesses (which imo are the primary sources of NPEs) I can only recommend mapstruct. You basically declaratively write what has to be mapped to what and it will generate at compile-time the necessary, performant Java code with proper null-handling, even n level deep.
So my empirical evidence is that NPEs ”million dollar” fallen victim of inflation :D
Thank you -- glad to hear there's been progress!
I think that’s reasonable if you are on a recent JVM version and expect to upgrade very regularly. Many are in organizations where that’s not the case.
Re:Scala 3 is not production ready
by 29athrowaway on Sunday November 20, 2022 @10:23PM
(#33688331)
The biggest annoyances in Java cannot be fixed for backwards compatibility reasons. It will always allow you to do the wrong thing.
What wrong thing?
Re:Scala 3 is not production ready
by 29athrowaway on Monday November 21, 2022 @07:58PM
(#33700446)
Java
Yes, some of my fellow engineers like it for the language itself, but I feel these days it's getting harder to argue that "the team using Kotlin is so much more productive than the team using Java".
Curious what HN thinks about this.