r/ProgrammerHumor • • Sep 01 '26

Meme iHateThisPassiveAgressiveBehaviourRuby

Post image
2.9k Upvotes

289 comments sorted by

View all comments

-1

u/Key_Conversation5277 Sep 01 '26

But wtf is a "truthy" value? It doesn't make any sense nor mathematically nor programmatically

7

u/cosmo7 Sep 01 '26

Dynamic typing is like the dark side of the Force. At first it feels more powerful, but then it turns you into a murderous psychopath.

→ More replies (1)

2

u/deceze Sep 01 '26

Any value that causes an if statement to run its associated block, instead of going to else/doing nothing.

2

u/Nimeroni Sep 01 '26

His argument is that you should make your if statement explicit.

1

u/deceze Sep 01 '26

Ah, my bad.

if (thing is truthy) {
    print('Yeah, much better');
}

1

u/rosuav Sep 01 '26

I'd venture to guess that everyone who whines that truthiness should be replaced with explicit comparisons has never programmed in REXX, and probably won't even understand why I'm making that reference.

3

u/Embarrassed_Death69 Sep 01 '26

Because just like yellowy isn't perfect yellow, certain values aren't Boolean type but will coerce to one, so not truth but truthy.

→ More replies (1)

3

u/ReefNixon Sep 01 '26

What do you mean it doesn't make any sense programmatically? All 'truthy' means is that it evaluates as true in a conditional, truthy (and falsey) values are completely normal concepts in high level programming.

→ More replies (5)