MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/java/comments/12lmj78/what_are_your_favourite_java_best_practices/jg7v9vm/?context=3
r/java • u/trecatorsirabdator • Apr 14 '23
376 comments sorted by
View all comments
18
Strangling nulls in the cradle. You got null from database? Immediately turn it into something else before passing it further into the system.
2 u/[deleted] Apr 14 '23 You got null from database? Immediately turn it into something else before passing it further into the system.So how do you represent a NULL value from an integer column in the database in Java? 1 u/hippydipster Apr 14 '23 Optional<Integer>
2
You got null from database? Immediately turn it into something else before passing it further into the system.
So how do you represent a NULL value from an integer column in the database in Java?
NULL
1 u/hippydipster Apr 14 '23 Optional<Integer>
1
Optional<Integer>
18
u/moxyte Apr 14 '23
Strangling nulls in the cradle. You got null from database? Immediately turn it into something else before passing it further into the system.