3 ms·
I love Python, but I always found CoffeeScript took Python's stylistic choices too far. Making {} around object literals and () after function calls optional le
by nickm12 9y ago
I love Python, but I always found CoffeeScript took Python's stylistic choices too far. Making {} around object literals and () after function calls optional led to code that was very difficult to visually parse.
- jononor 9y agoMy style guides to avoid this: - Only use {}-free object literals in assignment - Always add () to nested single-line function calls, and calls with expressions.
- molszanski 9y agoMy friend that is using cs every day now was also using () around every function call back in the day. Now he doesn't. I think it is more of a preference that _changes_ over time. Just saying that you might like it the other way one day
- nickm12 9y agoMaybe. I only used CS for one project, after years of primarily programming Python. I could also believe that, if applied judiciously, the characters could be dropped without harming clarity. However, the codebase I was working in had no clear style guidelines about when it was acceptable to drop braces/parens and so it left me wanting for Python's "there's one way to do it" aesthetic.
- molszanski 9y agoI agree. It is not advised to introduce confusing syntax if there is a chance that somebody outside of the group would use the code. It is even more frustrating in .js repositories today. People use various ESXX flavours and syntaxes that might not compatible with each other. Just look at this list: https://babeljs.io/docs/plugins/ https://babeljs.io/docs/plugins/ My favorite is: babel-plugin-transform-decorators-legacy (A plugin for Babel 6 that (mostly) replicates the old decorator behavior from Babel 5) Talk about code reuse