r/ProgrammerHumor 17h ago

Meme iHateThisPassiveAgressiveBehaviourRuby

Post image
2.4k Upvotes

263 comments sorted by

View all comments

420

u/deceze 17h ago

It's been a while since I've touched Ruby, but I think the stance was that only false and nil should be falsey? Which is not an unreasonable stance to take. The fewer falsey values, the easier it is to predict the behaviour. It's just surprising when coming from other languages.

Just off the top of my head, PHP treats "0", that is, specifically a string with a single zero, as falsey. Which has clearly gone too far to the other extreme.

15

u/requion 17h ago

I've worked with Ruby long enough now to say that "Ruby" and "reasonable" never go in the same sentence.

11

u/Abject-Kitchen3198 16h ago

They just did.

7

u/deceze 16h ago

Did… did I break Ruby?

SORRY GUYS, MY BAD!

4

u/Abject-Kitchen3198 16h ago

I doubt. The force required to break Ruby is huge. You need a diamond to barely scratch it.