Re:Can I get some reasons to use Java instead of Kotlin?
by Quekid5 on Monday May 17, 2021 @03:27PM
(#27187293)
It's actually kind of instructive to consider how Scala mostly solved the NPE issue by simply having Option available and discouraging use of null.
There are still issues at the API boundaries with Java or JS code, but that's about it. Outside of that, NPEs are usually in more niche places to do with initialization order and that sort of stuff.
Of course if you're inventing a totally new language you probably want to just avoid the possibility of null outright.
Re:Can I get some reasons to use Java instead of Kotlin?
by ByteWelder on Tuesday May 18, 2021 @04:21AM
(#27192329)
The "never use null" policy doesn't work across your third party dependencies, unless those dependencies coincidentally use the same policy as you.
I fairly strongly prefer Optional over nullable types. Especially how it works seamlessly with streams.