Truthy/Falsy Values
Discussions center on truthy and falsy values in programming languages like Python, Ruby, JS, and Lua, debating their convenience versus risks of confusion compared to strict booleans.
Activity Over Time
Top Contributors
Keywords
Sample Comments
That's already been adopted in Python with its "Truthy" or "Falsy" values!
likewise, I forgot about (boolean 0) being true and was confused for a few minutes today :)
You're talking about hard true/false, in which you are correct. The person you're replying to is talking about "Truthy"/"Falsy", which is different than the hard true/false you're talking about.
I hate truthy- and falsy-ness in general. It just seems like it's ripe for messing up expectations. Why not just get an actual boolean?
Compare Boolean Blindness (https://existentialtype.wordpress.com/2011/03/15/boolean-bli...).
For succintness' sake: you only need "0" a.k.a. FALSE. All else is TRUE.
It's not false. It's falsy.
I don't think false is truthy.
Yes (though it treats 1 as True and 0 as False, which it really ought to avoid).
Maybe because true is defined as anything that's not false?