Headshot-color me@jbrains.ca Find out where I'm appearing

jbrains Classic: Null as a method parameter

I originally published this on March 2, 2005.

Unless I’m publishing an API for general use, I don’t worry about testing method parameters against null. It’s too much code and too many duplicate tests. Besides, I would be testing the wrong thing.

When a method receives null as a parameter, the invoker—and not the receiver—is missing a test.

September 18, 2009 15:54 coding standards, design
blog comments powered by Disqus