
Null Is Benign - fogus
http://www.c2.com/cgi/wiki?NullIsBenign
======
makecheck
This is what Objective-C does for any message to nil (i.e. nothing). Though,
if you ever need to trap this behavior, and don't know exactly which nil value
you're interested in, some creativity is required. :)

------
wlievens
The first paragraph begins with a whole bunch of flawed assumptions.

"The basis of this discussion is the observation that NPE is quite common"

Not in my code. Use design by contract and NPE is no longer aproblem

"...most of the times it is "fixed" by writing code to check that
offendingObject != null before whatever triggered the NPE."

Not in my code. When an object is null you figure out the appropriate response
to that. Either it shouldn't be allowed to be null at this point, and you find
out why that is and fix that, or it should be allowed and you react
appropriately to it. What's the problem?

"a simple solution to NPE is to replace NPE with a default "behavior" for
all/any methods that are invoked on null object references: do nothing."

Except that doing nothing is impossible. Inaction is an action too, look at
your average contrived ethical conundrum for illustration.

How is NPE different from any other sort of bug? You find a problem? You fix
it, preferably just after writing a failing test case for it.

