4 ms·
Personally I’ve also always found Coffeescript easier to read and more pleasurable to write because of its syntax, especially its reliance on white-space. But i
by sings 6y ago
Personally I’ve also always found Coffeescript easier to read and more pleasurable to write because of its syntax, especially its reliance on white-space. But it seems this is one of those things that really divide people into two groups.
My only bug bear about coffee was its lack of a concise ternary, but it’s use of is/or/unless worked well for me.
I’m a bit sad that my Coffee/Pug/Sass/Yaml stack is supported out of the box in fewer places than it was, all sharing principles of less punctuation, and for me, more clarity as a result, but community support is pushing me towards migrating back to vanilla JS. Glad that some features are coming across, but things like destructuring aren’t as powerful (no [first, middle..., last]). Will be happy to see nullish coalescing come over.
I think the typing thing is relevant for big teams, something I’ve had the luck of avoiding for the most part.
- jrumbut 6y agoUnless is hugely valuable to me, "do x unless y" is great when x should happen in almost all cases. It avoids the noise of if statements, I really miss it in languages that don't have it.
- jbergknoff 6y agoI have a really hard time parsing `unless`. Whenever I encounter it in Ruby or CoffeeScript code, it takes me 10-30 seconds to stop and understand what's happening with the code. Generally, postfix conditionals are a bad idea because they are garden-path sentences [1] by design. Glad you find them valuable, but IMO they epitomize what many other comments in this thread have said about CoffeeScript's poor readability. [1] https://en.wikipedia.org/wiki/Garden-path_sentence https://en.wikipedia.org/wiki/Garden-path_sentence
- st1ck 6y agoI don't see anything common in structure between postfix `unless` and examples of garden-path sentences, which seem to be based on word ambiguity. Nothing is ambiguous in e.g. `print(x) unless x != 0`. Although admittedly without syntax highlighting, conditionality it's less obvious.
- jessaustin 6y agoYou're right, coffeescript's refusal to use python's more sensible ternary idiom ('normal' if condition else 'abnormal') is strange, especially since it already has the useful trailing-if idiom ('normal' if condition).