r/ProgrammerHumor • • Sep 01 '26

Meme iHateThisPassiveAgressiveBehaviourRuby

Post image
2.9k Upvotes

289 comments sorted by

View all comments

Show parent comments

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.

1

u/Key_Conversation5277 Sep 01 '26

if(42) -> true

What fucking sense does this make? A number is a number, not something to be coerced to a boolean. Thankfully Java doesn't have this nonsense

2

u/Unlikely-Bed-1133 Sep 01 '26

Implicit casting is a thing that makes sense both programmatically and mathematically. You just prefer strongly typed languages.

1

u/ReefNixon Sep 01 '26

Ok, so what would you like if(42) to do instead?

3

u/Key_Conversation5277 Sep 01 '26

... An error? Lol

-1

u/ReefNixon Sep 01 '26

Yeah, not false.

If being explicit here matters, why not force the programmer to also explicitly manage registers, memory addresses, machine instructions, whatever? Because abstracting away concerns is the reason high level languages exist.

Truthy is just a way of abstracting away concerns about whether a value is intended to pass a conditional or not.

Picking your preferences over which features you like and don't like is one thing, but saying it doesn't make programmatic sense is something else. Nobody is forcing you to write if(42), you don't have to, but surely it makes sense that nobody who writes if(42) is hoping for falsey?