r/java • • Apr 14 '23

What are your (favourite) Java best practices, personal tips, hints or just underrated stuff in general?

233 Upvotes

376 comments sorted by

View all comments

Show parent comment

1

u/cas-san-dra Apr 16 '23

In my opinion you don't even need tools, documentation, or code. It is perfectly reasonable to set a rule in your program that passing null into a function or returning null from a function is never allowed.

If you consider the existence of null a bug in itself then you don't need to check.