logoalt Hacker News

jeroenhd • today at 5:49 PM • 2 replies • view on HN

Until Java fixes its type system to add nullable types (and not in that ridiculous tri-state nullability method that one JEP proposes), Kotlin will be several steps ahead of Java.

I can speak from experience that Fable 5.1 still writes code that compiles and usually runs fine but throws null pointer exceptions in reasonable edge cases.


Replies

arein3 • today at 6:01 PM

Waiting so long for type safety and hoping it won't be a weird implementation.

Kotlin's implementation is very good, hoping with all my heart java will copy it

jmarlow47 • today at 7:56 PM

That's valid. Kotlins nullable types do help tremendously in that regard with AI-generated code. If Java nailed a nullable type system that's actually a win for Kotlin as well since Kotlin has to support "platform types" where it can't tell if Java code is producing null or non-null types.

That's probably the largest gap in usability.