7 ms·
Null is an element of any given set? I'm not sure I understand you there. Do you mean that e.g. "the absence of a natural number" is a member of the set of natu
by limmeau 17y ago
Null is an element of any given set? I'm not sure I understand you there. Do you mean that e.g. "the absence of a natural number" is a member of the set of natural numbers?
- chanux 17y agoYeah I was talking about the Null found in math. It makes me feel that 'Null everywhere' natural & we can use in our implementations safely.
- limmeau 17y agoBut there's an important difference: 0 is still a number and can safely be added to other numbers, "" is a string which can safely be concatenated with other strings. Java null, however, does not denote a neutral value, it denotes an absence of value, a hole in the paper where a value should be. In fact, if a type has a neutral element on the conceptual level (like 0 or the empty string or the /dev/null logger), then the null-object pattern is applicable and we can return NullObjects instead of null references, so null references are superfluous. If the type has no conceptual neutral element, however, the null reference doesn't relate to a meaningful entity on the conceptual level, either. (Medusa cars which kill you if you try to read the license plate are an obvious exception)