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.

📉 Falling 0.4x Programming Languages
3,118
Comments
20
Years Active
5
Top Authors
#303
Topic ID

Activity Over Time

2007
3
2008
33
2009
19
2010
45
2011
130
2012
110
2013
214
2014
230
2015
168
2016
129
2017
175
2018
145
2019
191
2020
256
2021
261
2022
305
2023
300
2024
176
2025
221
2026
7

Keywords

e.g IMO JS FALSE wordpress.com TRUE a.k IsFoo TS false true false boolean nil true values null numbers type strings

Sample Comments

iam-TJ Dec 2, 2022 View on HN

That's already been adopted in Python with its "Truthy" or "Falsy" values!

tosh Aug 10, 2019 View on HN

likewise, I forgot about (boolean 0) being true and was confused for a few minutes today :)

capableweb May 20, 2022 View on HN

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.

aetherson Dec 25, 2017 View on HN

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?

eru Jun 15, 2015 View on HN

Compare Boolean Blindness (https://existentialtype.wordpress.com/2011/03/15/boolean-bli...).

brass9 Sep 1, 2013 View on HN

For succintness' sake: you only need "0" a.k.a. FALSE. All else is TRUE.

lixtra Jan 28, 2018 View on HN

It's not false. It's falsy.

Y_Y Apr 13, 2025 View on HN

I don't think false is truthy.

mercurial Apr 23, 2014 View on HN

Yes (though it treats 1 as True and 0 as False, which it really ought to avoid).

mtdewcmu Jul 12, 2013 View on HN

Maybe because true is defined as anything that's not false?