Re:Poll: Have you moved from JavaScript to CoffeeScript?
by TrevorBurnham on Wednesday June 22, 2011 @04:42PM
(#2685153)
And I'd write
for i in [0...list.length] by 1
sum += list[i].amount
to get equivalent compiled output.I've used C and Java since high school, but I'm happy to be rid of that old `for` syntax. And I love that curly braces means only one thing in CoffeeScript: "I'm defining a new object with these key-value pairs."
Re:Poll: Have you moved from JavaScript to CoffeeScript?
by jimbokun on Wednesday June 22, 2011 @02:43PM
(#2684489)
The small bug in your code actually makes a good case for using the more concise syntax of coffeescript to help avoid those kinds of errors, while generating code that's just as efficient.
Re:Poll: Have you moved from JavaScript to CoffeeScript?
by augustl on Wednesday June 22, 2011 @03:08PM
(#2684602)
I disagree. In a real programming environment I'd notice immediately after running the code.
Re:Poll: Have you moved from JavaScript to CoffeeScript?
by utkarshkukreti on Wednesday June 22, 2011 @02:44PM
(#2684492)
Where are you setting `item` here?
EDIT: fixed minor oversight