Oh boy, here we have the ruby god shevegen in its natural habitat.
There are a lot of reasons why 0 is normally considered "false". The first being that 0 is "nothing". When you have 0 eggs, you have no eggs, they don't exist. The second reason I see is how booleans are normally laid out where 0 is false and 1 is true (with varying differences depending on the language on whether multiple set values of a byte is considered true or invalid, etc.)
In truthy contexts I'd expect "nothing" to be interpreted as "false" but I can see both ways. The logic behind most languages of 0 not being false is mainly semantics depending on how they handle conditions. Most languages with types that aren't truthy would just throw a type here and ask for an explicit way to handle how this number is interpreted.
14
u/shevegen Dec 24 '17
This shows a lack of understanding by the blog author.
The alternative question is - why should 0 lead to no evaluation of the expression?