3 ms·
Part of the problem is that NULL is used to convey meaning. e.g. "login" returns NULL if the user isn't logged in. So NULL can mean dozens of things. You can r
by jwilliams 17y ago
Part of the problem is that NULL is used to convey meaning. e.g. "login" returns NULL if the user isn't logged in.
So NULL can mean dozens of things. You can return something more valid (e.g. "Guest", or even "NotApplicable"), but doesn't get rid of the checks... Can result in more readable code though.
This is a good reference too:
http://www.infoq.com/presentations/Null-References-The-Billion-Dollar-Mistake-Tony-Hoare http://www.infoq.com/presentations/Null-References-The-Billi...
Edit: Plus there is a discussion on this talk here: http://lambda-the-ultimate.org/node/3186 http://lambda-the-ultimate.org/node/3186