4 ms·
I've never been a fan of unless blocks (as opposed to the unless postfix, which is a bit easier to swallow). The lower precedence spelled out boolean operators
by kbenson 6y ago
I've never been a fan of unless blocks (as opposed to the unless postfix, which is a bit easier to swallow). The lower precedence spelled out boolean operators (not/and/or) mean you can just use if not instead, which is just as readable in most cases and isn't confusing in the else case.
e.g.
unless ( $foo ) { }
if ( not $foo ) { }
- singingfish 6y agoyeah I tend to avoid unless - definitely in blocks, but it's ok for some postfixes