Re: NULLs

From: Hugo Kornelis <hugo_at_perFact.REMOVETHIS.info.INVALID>
Date: Tue, 08 Jan 2008 00:32:50 +0100
Message-ID: <e3d5o3hj2oolp551ht1dhcbeqflk5k0qap_at_4ax.com>


On Thu, 3 Jan 2008 17:57:18 -0800 (PST), JOG wrote:

>Okay, so you seem to be saying (and please correct me if I'm wrong),
>that you are fully aware that Nulls are a kludge, but in practice they
>don't seem to be doing you any harm so long as you take care when
>interpreting query results. I actually find it hard to argue against
>this. I can certainly argue against nulls theoretically until the cows
>come home, and as with all kludges they make me feel like i need to
>shower, but I am at a loss currently as to any negative practical
>consequences. This worries me ;)

Hi Jim,

Heh! I'd never put it quite as harshly as you just did, but I don't think I can really argue this.

Except the part that worries me - because I used to be worried about all the bad news about NULL, all the people claiming that 3VL was not good at all, etc. It used to worry me, because I build applications that rely on NULL and 3VL working as I think they should. So now that I know that NULL has no negative practical consequences, I can relax, knowing that the applications I build will not come crumbling down because I misunderstood some key points of NULL and 3VL.

What still worries me, though, is that the idea that NULLs are evil and should be avoided like the plague has become so wide-spread. I have already seen countless examples, out there in the real world, of databases designed to avoid NULLs. I have even seen text books suggesting to not allow any NULLs in databases. But of course, all these real world applications and all these text books still have to find some way to deal with missing information, so they often introduce magic values (like -1 in a numeric domain that should only allow positive numbers, 1900-01-01 or 9999-12-31 in a date domain, 'N/A' in a string domain, etc). This then turns out to be a far worse kludge than just using NULL for what it is intended to be used for!

If you want to call NULLs a kludge - fine by me. But please do also add that this kludge is the least of all evils when one has to model an SQL database, built on current database technology, that has to deal with potentially missing information. All other "solutions" are far more kludgy than NULLs will ever be.

Best, Hugo Received on Tue Jan 08 2008 - 00:32:50 CET

Original text of this message