I don't see any particular advantage to substituting a word like "empty" in place of a Null value, at least in general. I can imagine some particular application where that might help to call attention to missing data, but operationally, there is usually no penalty to just leaving a field Null. It does mean, though, that you have to keep in mind the possibility of retrieving a Null value from the database, so you can't use logic that depends on finding an actual value. I think it's good practice to always protect against a Null value crashing your logic, anyway.
For numeric fields, I would say that it depends on the significance of a field having no initial value. Well, that's true for any other data type, too, of course. If you need to make a distinction between missing data and data that is deliberately blank, then you need to start with Nulls. For example, if you have an accounting application with balances outstanding, it makes a difference whether an account is known to have a zero balance or whether there is no information on whether there's a balance or not.
don94403, June 6th, 2009 04:01 PM
Bookmarks