3 ms·
>> Kleene's that have three truth values (i.e. values assigned to literals): true, false ...and unknown. ... which is to say, "null". Regardless of what logic
by WkndTriathlete 8y ago
>> Kleene's that have three truth values (i.e. values assigned to literals): true, false ...and unknown. ... which is to say, "null".
Regardless of what logics exist the statement you make - that "unknown" is "null" - is actually wrong and the heart of the problem. "Unknown" is only one semantic interpretation of null; there are many others, and problems arise in software development because of those (sometimes slight) differences in the interpretation of what "null" should reflect in the real world.
Some sources suggest as many as 129 possible semantic meanings for "null", which is why Date rails against "null" values in SQL. With Option/Maybe we're constrained to the universe of values of that type plus exactly one more value (None); with null who knows how many of the 129 possible meanings of the null value we are dealing with in addition to the base type? Null is computationally and mentally expensive to deal with.
- zeth___ 8y agoThe same is true for true and false. What meaning gets attached to Boolean values is immaterial to how they act. That null is implemented oddly doesn't negate the fact it's a meaningful and well defined mathematical construct. I don't see people saying false doesn't exist because forth implements it as -1.
- YeGoblynQueenne 8y agoThis. Edit: removed unnecessary blablah.
- AnimalMuppet 8y agoBut how many of those 129 possible meanings for null are possible meanings for None in an Option type? And if you're going to say "only one", I'd suggest that you go through the list of 129 possible meanings for null very carefully to be sure...