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

Great, now you've got this weird logic on your style guide that your code reviewers will have to point to, and hopefully the new engineers on your team will remember. But maybe they're in a hurry and will quickly add another expression just this one time, multiplied by many engineers.

It's far simpler to ban use of unless.



It is neither weird, nor complex. Use unless in cases where the if has a single, negative condition.




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

Search: