Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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 ) { }


yeah I tend to avoid unless - definitely in blocks, but it's ok for some postfixes




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: