r/ProgrammerHumor 17h ago

Meme iHateThisPassiveAgressiveBehaviourRuby

Post image
2.4k Upvotes

264 comments sorted by

View all comments

10

u/SleepingInsomniac 15h ago

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

1

u/metaglot 15h ago

Nan != Nan is part of ieee754. If this isn't the case in ruby, ruby is not compliant.

1

u/SleepingInsomniac 15h ago

Float::NAN == Float::NAN # false til!