3 ms·
I never understood what Perl (and now Ruby) has against if statements. foo or do_something() is exactly the same as if foo { do_something() } Ex
by NateDad 14y ago
I never understood what Perl (and now Ruby) has against if statements.
foo or do_something()
is exactly the same as
if foo {
do_something()
}
Except the latter is WAY less likely to be accidentally misread.... and don't even get me started on
do_something() unless foo
- Smudge 14y agoIt's all just a matter of taste and preference. If you find yourself consistently misreading commonplace ruby, maybe ruby isn't for you.