I'm often asked why I still use CoffeeScript rather than ES6/7. Well, in truth I use both, but I do still prefer CoffeeScript for the following reasons:
- Correctly trimmed multiline strings (ES6 includes the indentation because it doesn't have significant whitespace)
- Existential operator (
a?.b
;b?()
;a?.b?()
and of coursea ? b
)a ? b
is more appropriate thana || b
if""
or0
are values ofa
you wish to persist(a && a.b && typeof a.b === 'function') ? a.b() : undefined
doesn't quite have the same ring to it asa?.b?()
- Significant whitespace
- (a personal preference, but since you already lay your code out sensibly why do you need the additional visual distraction of braces?)
- Convenient shorthand for common things (
->
(regular non-bound function),@
(this.
),::
(.prototype.
)) in
to check if something in a list