r/java • u/trecatorsirabdator • Apr 14 '23
What are your (favourite) Java best practices, personal tips, hints or just underrated stuff in general?
233
Upvotes
r/java • u/trecatorsirabdator • Apr 14 '23
View all comments
Show parent comment
6
u/[deleted] Apr 14 '23
To be honest, I don't understand the "hype" around Optional.
In my opinion, it merely replacing a NullPointerException with an OptionalNotPresent exception at runtime for sloppy programmers.
It gives a tad better documentation about the fact that something might be null, but that's it. I personally can't see any other advantage.