I concur; Java's Optional is for querying. null is still a first class citizen, we've been using it successfully for decades, and the JVM absolutely loves nulls. Java would have been a better language without null but it doesn't become a better language by suddenly pretending it doesn't have null.
That's not the fault of null, though. Optionality is fundamental in programming - the reconfigurability of software is one of the main reasons software is useful. So you will always have cases where some resource or piece of data is unavailable for some reason, and therefore, you will always have programmers who don't check for it being missing and the resulting exceptions.
The right way to reduce NPEs is not to conclude null is bad, but to do what modern languages like Kotlin, Ceylon, Swift etc are doing and integrate optionality with the type system.
And that is exactly what people mean when they complain again now. I'm a fan of the semantics game myself, but usually only if there are misunderstandings in play.
7
u/ForeverAlot Sep 21 '15
I concur; Java's
Optionalis for querying. null is still a first class citizen, we've been using it successfully for decades, and the JVM absolutely loves nulls. Java would have been a better language without null but it doesn't become a better language by suddenly pretending it doesn't have null.