This “geeky kind of logic” is a legacy that disrespects 0:
David Naseby wrote:
I’d contend there’s more of a “geeky
kind of logic” in 0 meaning false.
Tim Bates wrote:
This “geeky kind of logic” comes from back in the bad old days when
everyone wrote in assembly language (or C, which has all the power and
flexibility of assembly language with all the portability of assembly
language…). In those days, you didn’t have bools, or floats, or
strings - all you had were ints and arrays of ints. So one represented a
false value as 0 and a true value as 1 (or nonzero).
Equal rights for Numbers: 0 is a Number, too!
Sure, Numbers are Comparable. Sure, 0 might be less than some other Numbers,
but it’s greater than some Numbers, too.
No Number should be considered false. No Number deserves to be considered
false.
No Number has the negativity and emptiness that nil and false exude. All
Numbers are on if’s guest list[1].
Granted, in the past it’s true that 0 had no bits set. It took on the roles
of false and even nil even when the need was there.
Give it credit for that! Respect, too, that all Numbers, yes, even 0, have
an id now.
I dream of the day programmers esteem 0 as highly as mathematicians.
Respect all Numbers equally. Join the fight for equal rights for 0.
honk if 0
(Besides, it’s just a simpler rule – only false and nil are false)
[1] http://www.poignantguide.net/ruby/chapter-4.html#section2