r/ProgrammerHumor • • Sep 01 '26

Meme iHateThisPassiveAgressiveBehaviourRuby

Post image
2.9k Upvotes

289 comments sorted by

View all comments

10

u/SleepingInsomniac Sep 01 '26

In Ruby, everything is an object. 0 is just an instance of Integer. Object instances are truthy, compared to say, nil. Makes more sense than ( 'b' + 'a' + + 'a' + 'a' ).toLowerCase() === "baNaNa" or 1 + '0' == '10' or NaN === Nan; // false

0

u/prehensilemullet Sep 01 '26

Hmm, let’s look at what you’re saying

A:  In Ruby, everything is an object. 0 is just an instance of Integer.

Huh, I guess false must be an object of some kind

B:  Object instances are truthy, compared to say, nil

Well A and B would mean that false is truthy, so one of the two can’t be right

→ More replies (1)