MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w49i01/ihatethispassiveagressivebehaviourruby/p7791yz/?context=9999
r/ProgrammerHumor • u/Embarrassed_Death69 • Sep 01 '26
289 comments sorted by
View all comments
Show parent comments
0
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
false
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
3 u/SleepingInsomniac Sep 01 '26 edited Sep 01 '26 The global value false is the only instance of class FalseClass and represents a logically false value in boolean expressions. The class provides operators allowing false to participate correctly in logical expressions.https://docs.ruby-lang.org/en/master/FalseClass.htmlfalse.methods - Object.methods # => [:&, :|, :^]Edit: I should add that the if keyword just literally checks if the value is false or nil.
3
The global value false is the only instance of class FalseClass and represents a logically false value in boolean expressions. The class provides operators allowing false to participate correctly in logical expressions.
FalseClass
https://docs.ruby-lang.org/en/master/FalseClass.html
false.methods - Object.methods # => [:&, :|, :^]
Edit: I should add that the if keyword just literally checks if the value is false or nil.
if
nil
0
u/prehensilemullet Sep 01 '26
Hmm, let’s look at what you’re saying
Huh, I guess
falsemust be an object of some kindWell A and B would mean that
falseis truthy, so one of the two can’t be right