r/ProgrammerHumor 23h ago

Meme iHateThisPassiveAgressiveBehaviourRuby

Post image
2.6k Upvotes

277 comments sorted by

View all comments

2

u/TheTroll007 17h ago

I mean 0 is not nothing, so you can do "if x" and if x is not false or nil, you get true. I kinda like this approach.

u/IceMichaelStorm 1m ago

the only problem is that every other language (almost) treats it as false

1

u/BobQuixote 15h ago

But 0 is nothing. 0 bats is the same as 0 frogs.

2

u/Arxae 14h ago

Not i a programming context. 0 is still a value. Even though the value might represent nothing, it's still a value.

1

u/TheTroll007 11h ago

Even though there's no object, it's a different class. Nil is Nil class, 0 is Numeric. So it is something technically.

0

u/MinecraftPlayer799 12h ago

Can everyone keep this comment at exactly 0 votes?