4 ms·
0 does not indicate absence of value. Think of temperature - 0 is a valid temperature and is actually not equal to 0 when converted to Fahrenheit. It becomes in
by keymone 7y ago
0 does not indicate absence of value. Think of temperature - 0 is a valid temperature and is actually not equal to 0 when converted to Fahrenheit. It becomes incorrect to check presence of temperature by just relying on Boolean coercion, you have to check for not-None(in python) explicitly.
Generally the more special values, that are treated as false, you have in a language - the more complex and confusing your programs become. Just my opinion.
- a1369209993 7y agoNitpick: a actual zero (ie, in Kelvin or Rankine) is not a valid temperature but a lower bound that temperature can't actually reach (like -infinity for real numbers).
- keymone 7y agoyeah, fair point, maybe there's a better example, but i hope i've conveyed the idea: some zero values are not absence of values.