1 min readMay 5, 2020
I’ve sometimes thought that some programmers are making too big a deal about NullPointerException
. Then I looked at a Java project I had set aside for a few months. One class in the project had seven or eight warnings. I figured it would take me five minutes to clear those warnings.
Four or five of those warnings were “dereferencing possible null pointer.” It turns out that due to my limited understanding of instanceof
back then, I hadn’t written tests for null parameters. Needless to say, it took me way more than five minutes.