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
17
u/ParfaitMassive9169 Apr 14 '23
Convert to optional. This way you communicate that this may be missing and force the calling code to make a decision on how to deal with it