4 ms·
I've found the opposite with Coffeescript as far as returning to old code. It's clean, nicely indented, easy to follow. I don't use all of the shortcuts, though
by wambotron 13y ago
I've found the opposite with Coffeescript as far as returning to old code. It's clean, nicely indented, easy to follow. I don't use all of the shortcuts, though. For example, I'd never write a plain object without including the curly braces.
With javascript, there is SO MUCH there that it can be hard to read through.
- agumonkey 13y agoTruth lies in the middle. I can imagine javascript concise when writing with combinators such as those in Javascript allonge, it gets close to CS. While I fear CS can cross the perlish cryptic threshold too easily.
- pyrrhotech 13y agonicely 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 }