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

Though, what's the benefit of putting the conditional after? I find these:

    if badness throw 'error'

    unless goodness return null
to be more readable


It's definitely nice to see the return at the beginning of the line -- makes the code easier to scan.

And anytime there's code after a return, it had better be connected to a conditional. :)


Those are good points. I'd probably make it multi-line:

    if badness
      throw 'error'
    
    unless goodness
      return null




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

Search: