News for hackers. Stuff that matters.
Re:Apple Lossless Decoder in Coffeescript by Stratoscope on Tuesday December 20, 2011 @04:07AM (#3372806)
I've programmed in dozens of languages, and I can't think of another one where loops could automatically run either up or down depending on the start and end values.

Not knowing CoffeeScript well, when I see this code:

n = -10 for i in [0...n] doSomething()

I'd expect it to call doSomething zero times. At least that's what I'd expect in JavaScript or any of the other languages I've used.

Re:Apple Lossless Decoder in Coffeescript by jashkenas on Tuesday December 20, 2011 @07:56AM (#3373250)
I agree with you at least 40%, and that's originally how CoffeeScript behaved. Would you still feel that way if you had explicitly written:

    for i in [10..0]
I've opened a ticket to discuss this further: https://github.com/jashkenas/coffee-script/issues/1952