MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w49i01/ihatethispassiveagressivebehaviourruby/p76kxo0/?context=3
r/ProgrammerHumor • u/Embarrassed_Death69 • 17h ago
264 comments sorted by
View all comments
10
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
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!
1
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!
Float::NAN == Float::NAN # false til!
Float::NAN == Float::NAN # false
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"or1 + '0' == '10'orNaN === Nan; // false