News for hackers. Stuff that matters.
Re:CoffeeScript: less typing, bad readability by jashkenas on Monday September 17, 2012 @04:07PM (#4534587)
Postfix conditionals are pretty nice for conditional statements that are particularly unlikely to happen. Imagine, in a function body:

    read(file)
    write(file) unless terriblyUnlikelyThingHappens
    return results
... it helps to keep the expected main-line flow of your instructions reading smoothly -- much the same as the way you'd tend to use it in English. Doing it the "normal" way instead:

    read(file)
    if (!terriblyUnlikelyThingHappens) {
      write(file)
    }
    return results
... makes it a bit more difficult to follow what should be going on in the function.

There are no comments on this comment yet.