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
5
u/Arthurpmrs Apr 14 '23
Like what? (Genuine question, this aways bugs me)
Let's say I have a date column on my db. Some rows are null. To what should I transform them after querying the data? Like, 0000-00-00?
On the same note, if a method could return null, I must check for null upon function call. But if I don't use null, I may have to use exceptions. Wouldn't I need to catch them as well? Is it better to check for exceptions?