4 ms·
The lack of visual clutter like brackets, semicolons, the var keyword, and the addition of significant whitespace are some of Coffeescript's strengths. Some ot
by lowboy 13y ago
The lack of visual clutter like brackets, semicolons, the var keyword, and the addition of significant whitespace are some of Coffeescript's strengths.
Some others are loop variable initialization, better hasOwnproperty checks, destructuring assignment, null soaking on objects, string interpolation, and array ranges.
I've never found a good case for named functions over function expressions, other than maybe arbitrary order of source code. Even then, I usually put functions at the top of my files before they would be used in the script's execution. But to each their own.
I don't use list comprehensions that often.
I'd take CS over JS any day.
- pyrrhotech 13y agohow about when debugging? nice to see function name in stack traces. You can use named function expressions in JS, you can't in CS
- lowboy 13y agoYup, good point. Apparently a future version of CS or CSRedux will have it so that this CS: myFn = ()-> # function body Gets compiled to this JS: var myFn = function myFn() { // function body }