4 ms·
nicely indented? Install jsbeautify plugin in sublime, on save, your codebase will be beautiful and consistent. Brackets, semicolons, insignificant whitespace
by pyrrhotech 13y ago
nicely indented? Install jsbeautify plugin in sublime, on save, your codebase will be beautiful and consistent.
Brackets, semicolons, insignificant whitespace, var keyword, and named functions are some of Javascript's strengths. List comprehensions are nice, but be honest, how many times per year do you use them?
I'd take JS over Coffee any day
- lowboy 13y agoThe 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 }