4 ms·
> Java will never be able to compete with Kotlin in this regard, as Java language architects value backward compatibility over code safety. Never is a strong s
by MichaelNolan 4y ago
> Java will never be able to compete with Kotlin in this regard, as Java language architects value backward compatibility over code safety.
Never is a strong statement. The java team spends a good amount of time thinking on how they could bring Nullability into the type system. It’s certainly possible we could get it as apart of Project Valhalla - https://mail.openjdk.org/pipermail/valhalla-spec-experts/2023-February/002223.html https://mail.openjdk.org/pipermail/valhalla-spec-experts/202...
Aside from future language changes that could bring direct null safety, there are practical tools like NullAway that essentially give us everything Kotlin has.
- pestatije 4y agoI think null types is a worse solution than annotations...the only thing we need is a true standard.