I was looking at some of my old repos today. Enjoyed the nostalgia. Lots of CoffeeScript there. I had to switch to ES and then TypeScript because CoffeeScript was abandoned at the time and I was stretched over other projects to be able to help maintain it. Reading my old code, I was surprised by how clean it looks. How easy it is to digest. There is a certain sense of calm when your brain doesn't have to process all…
> How easy it is to digest I’ve not had this experience. I’ve found the ambiguity in coffeescript a maddening adventure in syntax confusion. - function call syntax doesn’t need parens except if a 0 parameter method - commas are largely optional both in arrays and function parameters. How do you parse: [f, f(), f a b c] - implicit returns are a terrible idea. - the @ syntax refers to either a ‘static’ method or an ins…
> function call syntax doesn’t need parens except if a 0 parameter method
Function call syntax doesn't require parens so to make multi-line calls punctuation-free. Especially if some args are objects.
> commas are largely optional both in arrays and function parameters. How do you parse: [f, f(), f a b c]
Well commas are not optional.
> implicit returns are a terrible idea
They're especially elegant in writing declarative code. It takes some getting used to though.
> the @ syntax refers to either a ‘static’ method or an instance variable depending on the context.
Agreed.
These are all tradeoffs though. For me, they struck the right balance between ambiguity (very little) and expressiveness.
LiveScript in comparison was much more sugary (which I preferred): https://livescript.net/