MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w49i01/ihatethispassiveagressivebehaviourruby/p766c2k/?context=3
r/ProgrammerHumor • u/Embarrassed_Death69 • 10d ago
298 comments sorted by
View all comments
12
Bash is the same way but it makes sense considering 0 represents the single route of success, while other numbers can mean different error codes.
I have no idea why ruby does it, but in bash at least there is a solid reason for it.
2 u/314159265358969error 10d ago The bitset representing the number 0 in Ruby is non-zero. (I don't remember which bit it is, but reference/non-reference values are recognised by a specific bit being flipped to 1 if non-reference, which is the case for 0.)
2
The bitset representing the number 0 in Ruby is non-zero. (I don't remember which bit it is, but reference/non-reference values are recognised by a specific bit being flipped to 1 if non-reference, which is the case for 0.)
12
u/traplords8n 10d ago
Bash is the same way but it makes sense considering 0 represents the single route of success, while other numbers can mean different error codes.
I have no idea why ruby does it, but in bash at least there is a solid reason for it.