What’s Null Really?

Nullability can be quite an artificial concept to think about. When something is null, is it undefined or what? Consider the example of a phone book. Given a name, you can look up a phone number. But what if you don’t find an entry? Does it mean the person doesn’t exist at all, or does it mean that person doesn’t have a phone? Not to mention private numbers that are unlisted!

Unfortunately, opinions vary. Some say null indicates no value has been set; however, the answer is that there’s no answer. Others overload the meaning to indicate situations where no value can be found or computed: It’s impossible to formulate an answer. In my opinion, the latter interpretation should be avoided. Why? Null is simply not a good way to ...

Get C# 5.0 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.