On Fri, 6 Jun 2003, Mattias Kregert wrote:
> 1. Imagine a table with dates and weather conditions. How would you
> differ between "zero degrees" and "no data entered yet"? You would
> have to add a column (degrees_valid boolean). Having the NULL value
> makes things much easier.
>
> 2. In OO languages (c++, java, and so on), a null pointer is very
> different from a pointer to an object - even if that object contains
> the value 0 (zero) or an empty string (""). The "practices" you refer
> to does not apply/is not inherent in all languages. NULL means that
> the variable points to nothing at all. "" means that there is some
> address/space allocated.
> Example:
> String mystring = NULL; // pointer mystring points to nothing (no
> allocation)
> String mystring = new String(""); // pointer mystring points to a
> memory location, which currently holds the empty data "".
<click!>
Thank you Mattias, the differences (and similarities) are now clear.
Cheers!
Jon
--
Jon Earle
SAVE FARSCAPE http://www.savefarscape.com/