News for hackers. Stuff that matters.
Re:CoffeeScript: The beautiful way to write JavaScript by seanalltogether on Tuesday March 08, 2011 @06:06PM (#2302977)
Also, with a language like javascript, shouldn't we worry more about faster performance then beautiful syntax.
Re:CoffeeScript: The beautiful way to write JavaScript by jashkenas on Tuesday March 08, 2011 @07:27PM (#2303234)
Absolutely, and CoffeeScript worries about your JS performance for you, when it can. In my personal experience, translating JS to Coffee tends to speed up the performance of the resulting script, due to the optimizations the CoffeeScript compiler adds.

To be specific, the main speedup I tend to get is this: If I'm working with JS, I'll tend to use a "forEach" function frequently, for looping over lists:

    list.forEach(function(item){ item.transform(); });
In CoffeeScript, you'd write it like this:

    item.transform() for item in list
... and instead of the slow "forEach" function, you get a much faster native "for" loop.
Re:CoffeeScript: The beautiful way to write JavaScript by cpeterso on Wednesday March 09, 2011 @07:35PM (#2307369)
Does CoffeeScript include an optimizer/minifier? Google's "Closure" Compiler for JavaScript is able to inline functions and perform other interesting optimizations.