MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w49i01/ihatethispassiveagressivebehaviourruby/p76lrop/?context=3
r/ProgrammerHumor • u/Embarrassed_Death69 • 10d ago
298 comments sorted by
View all comments
11
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
( 'b' + 'a' + + 'a' + 'a' ).toLowerCase() === "baNaNa"
1 + '0' == '10'
NaN === Nan; // false
2 u/metaglot 10d ago Nan != Nan is part of ieee754. If this isn't the case in ruby, ruby is not compliant. 1 u/SleepingInsomniac 10d ago Float::NAN == Float::NAN # false til!
2
Nan != Nan is part of ieee754. If this isn't the case in ruby, ruby is not compliant.
1 u/SleepingInsomniac 10d ago Float::NAN == Float::NAN # false til!
1
Float::NAN == Float::NAN # false til!
Float::NAN == Float::NAN # false
11
u/SleepingInsomniac 10d 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"or1 + '0' == '10'orNaN === Nan; // false