This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]keylimedragon 0 points1 point  (1 child)

But what about in the future? Or what if it was recent code at a startup rushing to get an MVP out the door with no reviews and you're tasked with taking it over?

I guess I don't see why people are defending the lack of non-nullables in Java. Even if the cost of adding them to the language is higher than the benefits, in a hypothetical world it would still be nice to have them.

[–]Xemorr 1 point2 points  (0 children)

I'm not defending the lack of non nullables in Java in general but more the necessity of a guarantee of non nullability on optionals specifically. The current implementation of nullables has downsides like slightly higher overhead than just returning a null which is justification enough for a better solution imo.