3 ms·
Funny how a little care in naming can save countless hours of confusion and explanation. In the original case of VBScript, if the value had been called "Unknow
by dkarl 18y ago
Funny how a little care in naming can save countless hours of confusion and explanation. In the original case of VBScript, if the value had been called "Unknown" instead of "Null," it would have saved a lot of confusion.
Now when it comes to languages like Java with only one special non-value value, "null" or "Null" or "Nothing," you have to know the context to know what it means. It might mean "this value is unknown," "this value has not been calculated yet," "an invalid value was calculated," or "there's a bug in the program." Or it might be overloaded to mean that one or more of those might be true.
If exactly one of those special cases is possible in your program, then everything is peachy: use null to represent that case. If you need to represent zero or more than one of those cases, then you'll end up with some kind of ugliness or imprecision.