The Nature of NULL

NULL Modem“Is not the beginning of wisdom the words: ‘I do not know’?”

– Data, Star Trek: Next Generation: “Where Silence Has Lease

If the beginning of wisdom is to realize what it is that we do not know. NULL, by its definition is this not knowing.  We do not know what NULL is, this is why it is NULL.

What is this?

Null is not a number, or letter.  It may not even be a character.  Using Occam’s razor, things are either NULL or NOT NULL.  Things that are NULL are completely unknown at the time they are NULL.  And things that are NOT NULL are not completely unknown when they are NOT NULL.

I feel the hair splitting on my head, so let me explain one important point.  Things that are NULL are not destined to stay that way.  Where /dev/null/ is the black hole of output that we don’t need, NULL is not the data equivalent of a black hole.  Things that are currently NULL may become NOT NULL at any time, as soon as we know something about them.  Pretty much anything really.

Empty String TheoryBall of String

Unlike string theory, which attempts to define the nature of the universe, the ‘empty string theory’ is that empty strings are the same thing as NULL.  They are not.  If they were NULL, we would not know that they were strings.  This seems quite clear.  NULL is NULL and an empty string is NOT NULL.

“But wait!”  I hear a Database Developer cry.  “I can create a field in my database that is a string, and allow it to be NULL.”  And this is correct, but this is not a contradiction.  When you allow a database field to be NULL you have allowed it to receive NULL as an input.  But it may or may not give NULL as an output.  Because we can put NULL into a variable, when we query for that variable, element, whatever, we may get NULL, or we may get an empty string or property defined value of that data type of the field, that just happens to be empty.

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 0 apples as a way to say, “Hey, this basket is for apples!”  So is 0 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.

Related Articles:

Posted in Data Tagged with: , , ,
5 comments on “The Nature of NULL
  1. Hi Roy. Very interesting webiste you have here. :)

    I wanted to thank you for visiting my blog and offering me some great advice. I noticed on your blogger profile page that you are writing sci fi too. And that you are a fellow Utahn. Cool!

  2. Michael says:

    Really enjoyed this post! Some of your best stuff so far!

    -Michael

  3. chad says:

    Very interesting article. I came across this because I was researching ideas about the foreknowledge of God and I wondered if the principle of bivalence applied to God’s foreknowledge. Specifically, “Must God now know a statement that expresses a future contingency as only True or False?”. My thought was that that was a false dilemma and that there was a third category, “Might/Might not”. This led me to 3-valued logic and that led me to your article on the idea of “NULL”.

    Presuming as simpliciter that tomorrow will come, that the man involved has free will in this matter, and that God knows all things, we say God knows the value of the statement, “Bob will murder tomorrow.” as neither true nor false but a third state, “might or might not”.

    It is interesting to me how that there seems to be some relationship between “might or might not” and “NULL”, though I don’t have the time at the moment to put it all into words here…
    thanks!

  4. chad says:

    I appreciate your comment: “Just as early civilizations had no concept of zero, early discourses of NULL struggle with it.”

    Whereas the idea of ‘possibility’ existed in ancient times, when a future contingent event was considered it was only considered as definitely so or definitely not so, with probability being only intuitive at best, having no idea that there could be metrics between 0 and 1 associated with possibility. IMO, the ontological existence of probability is important to float the concept that there is a third state of God’s foreknowledge. In doing a preliminary search on the Science of Probability, it looks like it is relatively new (starting in the 17th century) and that in the last century becoming mature. This may be why ancient and early theologians were unable to consider such a category at all or as valid: they had no concept or competent tools to help them consider such.

  5. Roy says:

    Chad,

    An interesting exploration. I hadn’t really considered any theological ramifications of the concept of NULL being applied to the Ubiquitous nature of God. I think most people who even think about the foreknowledge of God either assume that this knowledge of our choices, ie: Bob and his future murder, and fall in to two camps. Bob will or will not commit murder because that was how he and everything else was created to work. Or, that God has such a complete knowledge of the variables in play that God can make a perfect prediction.

    But an examination of NULL gives us another thing to consider. Just like I discussed, that if I insert a NULL into a record that will accept a NULL but has a type. When I query that record, that NULL convert to a value. If the type is a int, I get a 0 back. If the type is a string, I get “” back, and so forth.

    In God’s database or coding language, there might be a “commitsMurderTomorrow” type. And when a NULL is assigned to this value, querying it will get back an answer that is not NULL, and is also not a default answer like the empty string and 0 but a predictive result.

    In this way asking the question does not exactly cause the answer to come true, but it allows for God to have knowledge of the future, but not causing it unless he asks the question/queries the database for the answer.

    I don’t know that this really works out in helping us understand NULL, or programming, but it is interesting to think about nothing sometimes. :)

    Glad you enjoyed it.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Categories