A language that truly supports null has monadic types, meaning that typed value (scalar, string, object, etc) or something else is specifically tracked (null, undefined, etc). Languages that do not natively support that often have developers that cheat, where they assign some particular value to represent null. Commonly, this is 0 or -1 in numbers and an empty or literal "null" in strings. This works fine unless these values appear actually as legitimate values.
Lately, I program in a language that has distinct concepts of Null and Empty and Nothing and the empty string ("") and arrays that are not Empty but contain zero elements. And of course NUL characters.
This is obviously at least five times as good as just having one option for null.
Well, Empty is a special value in VBA. And I forgot to mention, there are two kinds of "empty" arrays that are not Empty. So it's six times as good as a normal
language.
Here's an example:
' x can be anything, including an array, but
' defaults to the value Empty.
Dim x
' y is an array of values that can be anything,
' which defaults to an empty array.
Dim y()
' Initialize x as an empty array
x = Array()
' The following two statements print 0 and -1.
Debug.Print LBound(x)
Debug.Print UBound(x)
' The following two statements error with
' "Subscript out of range" even though y
' is also a kind of empty array.
Debug.Print LBound(y)
Debug.Print UBound(y)
Ok, I wasn't thinking of C, but even so, isn't NULL a pointer value, not an integer? If you're treating a null pointer as an integer zero, something's gone very wrong.
Also I think I vaguely remember from discussions about the standards, that a NULL pointer is not guaranteed to be numerically equal to zero in a standards compliant compiler.
C++03 and earlier stipulate that literal 0 is always the null pointer, whether it really is on any given hardware or not. C++11 and later deprecate this and introduce a new keyword `nullptr`.
edit: Also, null is not an empty string. The null character that terminates a string is unrelated to null pointers.
Man, this is one of those discussions I’d like to drag out for a little bit, but unfortunately not in a position to do so. I will leave you with the idea that null can indeed be a value, as in a null-terminated string. Go look at that guy in memory.
If you're going to split hairs, I'm going to say a NUL character is obviously not the same concept as a NULL in general, nor is it a number that you'd use for a coordinate.
The definition of NULL is technically machine-dependent in C. It happens to be 0 on (almost?) every machine, but that's not guaranteed. In C++ it's guaranteed to be 0.
Null is the absence of a value. When used in a programming context it is either a pointer (which is not an integer or a float -- it's the pointer to the absence of an integer or a float. It is not equivalent to 0 or 0.0 or ""), a magic number (specifically for chars), or a special structure with a flag.
This more correctly would be "Default=0 Island". A database that doesn't have a nullable field would be the one where you'd have 0.0 as the defaults.
Edit: this is a serious question.