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

You need to use it when you want to be negative of ALL the thing after unless.

Basically, do_something unless A

Then it's simple now to manipulate the inside of A, as you only take care of the positive ! That's beautiful and simple design.

Example is you want to validate something.

raise Error unless someValidCondition.

Now decompose someValidCondition by just using positive connectives, simple right ?



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

Search: