The Nature of NULL - Page 2

In final reply to this inquiry I must observe that NULL is not equal to anything. Any conditional statement where NULL is compared to something will be false. Where "" represents an empty string, if one writes the statement, ["" == ""], or in English, "if an empty string is equal to an empty string," it evaluates as a true statement. However if one writes the statement [NULL == NULL], or in English, "if NULL is equal to NULL," it evaluates to a false statement. Since an empty string is equal to another empty string, but NULL is not equal to NULL, then NULL cannot be the same thing as an empty string.

Why NULL is Important

Just as early civilizations had no concept of zero, early discourses of NULL struggle with it. Where we can argue if you have zero apples, is the same as having nothing. Yet it can be the absence of something that is known. Zero can be having none of something. But NULL is not even knowing what the something is that you don't have.

Bushel of ApplesAn apple basket can contain zero apples as a way to say, "Hey, this basket is for apples!" So is zero greater than NULL. Because with null we don't know what the basket is for. We may not even have a basket at all.

There are a great number of operations that we couldn't do well or efficiently if we didn't have NULL. So understanding what we are asking when we look for NULL is important. Whenever we have a search for things that don't match something else, we are searching for NULL, even if the values themselves are not NULL. We do this a lot, and we couldn't do it without NULL.

Page 1 — Page 2

Article tags

Spread the word
Bookmark and Share
Profile image for roy-hayward

Article Author: Roy Hayward

Roy studied chemistry and political science in college, and spent his early days in computers playing with them as a hobby, but discovered that they made a better career. Entering into the field as end user tech support, Roy move on to system and …

Visit Roy Hayward's author pageRoy Hayward's Blog

Read comments on this article, and add some feedback of your own

Article comments

  • 1 - Brian aka Guppusmaximus

    Dec 25, 2008 at 7:48 am

    Excellent Article...

    Thanks for the mental workout & the clarification.

Add your comment, speak your mind

Personal attacks are NOT allowed.
Please read our comment policy.
Please preview your comment.

blogcritics lists for Nov 23, 2009

fresh articles Most recent articles site-wide

fresh comments Most recent comments site-wide

most comments Most comments in 24hrs

top writers Most prolific Blogcritics for October

top commenters Most prolific Commenters in 24 hrs