4 ms·
Also, with a language like javascript, shouldn't we worry more about faster performance then beautiful syntax.
by seanalltogether 16y ago
Also, with a language like javascript, shouldn't we worry more about faster performance then beautiful syntax.
- jashkenas 16y agoAbsolutely, 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.
- cpeterso 16y agoDoes CoffeeScript include an optimizer/minifier? Google's "Closure" Compiler for JavaScript is able to inline functions and perform other interesting optimizations.