2 ms·
Well I really showed myself up as commenting on a topic that I know nothing about! :-) But that's actually ideal in this context, a really low precedence opera
by quietbritishjim 4y ago
Well I really showed myself up as commenting on a topic that I know nothing about! :-)
But that's actually ideal in this context, a really low precedence operator is exactly what you want because you can swap `unless` for `if not` without worring about extra parentheses:
send_email if not user_suspended? || user_opt_out?
- greenpeas 4y agoI wouldn't use this. Relying on tricky operator precedence can trip up your readers. It's better to just wrap everything in parentheses. I also use parentheses when mixing && and ||, even though their precedence relationship is (probably) more widely known. I generally avoid `not`, `and`, `or` keywords.