Hacker News new | ask | show | jobs
by drinkcocacola 685 days ago
It is indeed annoying. For Kotlin, its advantage is that it had the nullability concept from its inception. For Java, they need to make sure previous code behaviour does not change, meaning that they need to add an additional marker to the explicitly mark "not null" types.

Probably in some years from now once codebases exclusively use this feature, there would be a way to tell the compiler that the default type (without marker) it is a non-nullable type.

1 comments

"Our colleague Alex Buckley, specification lead for the Java language and JVM, likes to say that one of the surprising things is that Java managed to get all the defaults wrong and still succeed"

[Source](https://blogs.oracle.com/javamagazine/post/what-are-they-bui...

In that regard, I would say Java is in good company => C, C++, JavaScript, PHP.