I don't, generally, allow nullsunless I have a darn good reason.
The biggest reason for NOT using NULLs is that they are so meaningless. You
have no idea what it means if someone enters a NULL. Does it mean the value
isn't known now, the value can never be known, the value isn't relevant, or
something else.
Earlier today there was a post where someone was adding numbers and wanted
NULL to be considered 0. Someone used the example of a bank account balance,
and said a 0 would really mean no money, but NULL would mean no bank
account. That is not completely true. NULL could also mean that you are just
so disorganized you haven't balanced your statement in years, and you have
absolutely no idea what your balance is. It also could mean you haven't
looked in the last day and just don't know right now.
NULL means unknown, and there are so many reasons a value could be unknown
that I like to avoid it if possible. Plus the fact that NULLs are never
equal to anything, but they are also never NOT equal to anything, so you end
up with tri-valued logic. This makes your coding much more complex.
So what's your point?
-- Carol wrote: --
I don't, generally, allow nullsunless I have a darn good reason.
The biggest reason for NOT using NULLs is that they are so meaningless. You
have no idea what it means if someone enters a NULL. Does it mean the value
isn't known now, the value can never be known, the value isn't relevant, or
something else.
Earlier today there was a post where someone was adding numbers and wanted
NULL to be considered 0. Someone used the example of a bank account balance,
and said a 0 would really mean no money, but NULL would mean no bank
account. That is not completely true. NULL could also mean that you are just
so disorganized you haven't balanced your statement in years, and you have
absolutely no idea what your balance is. It also could mean you haven't
looked in the last day and just don't know right now.
NULL means unknown, and there are so many reasons a value could be unknown
that I like to avoid it if possible. Plus the fact that NULLs are never
equal to anything, but they are also never NOT equal to anything, so you end
up with tri-valued logic. This makes your coding much more complex.
No comments:
Post a Comment