3 ms·
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 behav
by drinkcocacola 2y 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.
- yas_hmaheshwari 2y ago"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-buildingand-why-6-questions-for-the-top-java-architects#:~:text=That's%20why%2C%20Goetz%20says%2C%20in,managed%20to%20survive%20these%20mistakes.%E2%80%9D) https://blogs.oracle.com/javamagazine/post/what-are-they-bui...
- pjmlp 2y agoIn that regard, I would say Java is in good company => C, C++, JavaScript, PHP.