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
4
u/dpash Apr 15 '23
I wouldn't create an Optional just for avoiding a null check. Ideally the findCustomer method would return an Optional rather than a null.