Skip to content

Instantly share code, notes, and snippets.

@benjie
Last active January 17, 2023 15:16
Show Gist options
  • Select an option

  • Save benjie/d0e39fbe8a61bc30ed93 to your computer and use it in GitHub Desktop.

Select an option

Save benjie/d0e39fbe8a61bc30ed93 to your computer and use it in GitHub Desktop.

Revisions

  1. benjie revised this gist Jan 30, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    ES6 is cool, but CoffeeScript still does it better
    ==================================================
    Long Live CoffeeScript and Long Live ES6
    ========================================

    Clearly ES6 is a huge improvement over ES5, and tools like [6to5][] allow us to use these cool features now. I was reading [Replace CoffeeScript with ES6][replace coffeescript] by [Blake Williams][] and thought it was a great summary of how ES6 solves many of the same problems that CoffeeScript solves; however I'd like to comment on a few of Blake's points.
    Clearly ES6 is a huge improvement over ES5, and tools like [6to5][] allow us to use these cool features now. I was reading [Replace CoffeeScript with ES6][replace coffeescript] by [Blake Williams][] and thought it was a great summary of how ES6 solves many of the same problems that CoffeeScript solves; however I'd like to comment on a few of Blake's points and talk about why I'll be sticking with CoffeeScript.

    Classes
    -------
  2. benjie revised this gist Jan 30, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -165,7 +165,7 @@ Conclusion

    All in all ES6 is a great leap forward for JavaScript and my huge thanks to all the developers who have made this possible. Not mentioned above are many of the features that ES6 has added that don't involve syntax changes and hence CoffeeScript can use without changes, such as Proxies, WeakMaps and much more. (We even have `yield` now too.)

    I still prefer CoffeeScript's syntax and find it very readable yet concise which significantly boosts my productivity. I would also find it hard to give up all CoffeeScript's various syntax sugars, such as: `object?.property` (rough JS equivalent: `typeof object !== 'undefined' && object !== null ? object.property : undefined`) which allows me to access the property of an object if it exists, or `undefined` if not, without throwing an error; `a ?= b`; `a ||= b`; implicit returns; `unless`; improved `switch`; ranges `[a..b]`; array/string slicing with ranges `arr[2..6]`; `for own k, v of obj`; chained comparisons `a < b < c`; block RegExps; and many more!
    I still prefer CoffeeScript's syntax and find it very readable yet concise which significantly boosts my productivity. I would also find it hard to give up all CoffeeScript's various syntax sugars, such as: `object?.property` which doesn't throw if object is null/undefined; `a ?= b`, `a ||= b`, etc.; implicit returns; `unless`; improved `switch`; ranges `[a..b]`; array/string slicing with ranges `arr[2..6]`; `for own k, v of obj`; chained comparisons `a < b < c`; block RegExps; and many more!

    ### Long live CoffeeScript and long live ES6!

  3. benjie revised this gist Jan 30, 2015. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -159,14 +159,13 @@ It wouldn't be fair to try and paint CoffeeScript as a perfect language - it cer

    - The ternary operator `a ? b : c` (`if a then b else c` is too verbose for my taste; that said there's no way I'd give up the ` ? ` operator!)
    - Computed (dynamic) property names, `{[getKey()]: getValue()}` (see the links in [this StackOverflow answer](http://stackoverflow.com/a/13998890) for some [interesting](https://github.com/jashkenas/coffeescript/issues/786) [history](https://github.com/jashkenas/coffeescript/issues/1731))
    - Generators ([coming very soon](https://github.com/jashkenas/coffeescript/issues/3073#issuecomment-71464718))

    Conclusion
    ----------

    All in all ES6 is a great leap forward for JavaScript and my huge thanks to all the developers who have made this possible. Not mentioned above are many of the features that ES6 has added that don't involve syntax changes and hence CoffeeScript can use without changes, such as Proxies, WeakMaps and much more.
    All in all ES6 is a great leap forward for JavaScript and my huge thanks to all the developers who have made this possible. Not mentioned above are many of the features that ES6 has added that don't involve syntax changes and hence CoffeeScript can use without changes, such as Proxies, WeakMaps and much more. (We even have `yield` now too.)

    I still prefer CoffeeScript's syntax and find it very readable and concise - less code is less bugs - not to mention all its various helpers to make it easy for me to avoid common pitfalls for example safe null references with `object?.property` (rough JS equivalent: `typeof object !== 'undefined' && object !== null ? object.property : undefined`).
    I still prefer CoffeeScript's syntax and find it very readable yet concise which significantly boosts my productivity. I would also find it hard to give up all CoffeeScript's various syntax sugars, such as: `object?.property` (rough JS equivalent: `typeof object !== 'undefined' && object !== null ? object.property : undefined`) which allows me to access the property of an object if it exists, or `undefined` if not, without throwing an error; `a ?= b`; `a ||= b`; implicit returns; `unless`; improved `switch`; ranges `[a..b]`; array/string slicing with ranges `arr[2..6]`; `for own k, v of obj`; chained comparisons `a < b < c`; block RegExps; and many more!

    ### Long live CoffeeScript and long live ES6!

  4. benjie revised this gist Jan 30, 2015. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -155,9 +155,9 @@ ES6 does object de/structuring pretty much the same as CoffeeScript (`var {a, b}
    Things ES6 has that I wish CoffeeScript had
    -------------------------------------------

    It wouldn't be fair to try and paint CoffeeScript as a perfect language - it certainly is not without its faults. Here's a list of features from ES6 (and even ES3) that I really miss in CoffeeScript.
    It wouldn't be fair to try and paint CoffeeScript as a perfect language - it certainly is not without its faults. Here's a list of features from ES6 (and even ES3) that I miss in CoffeeScript:

    - The ternary operator `a ? b : c` (`if a then b else c` is too verbose for my taste)
    - The ternary operator `a ? b : c` (`if a then b else c` is too verbose for my taste; that said there's no way I'd give up the ` ? ` operator!)
    - Computed (dynamic) property names, `{[getKey()]: getValue()}` (see the links in [this StackOverflow answer](http://stackoverflow.com/a/13998890) for some [interesting](https://github.com/jashkenas/coffeescript/issues/786) [history](https://github.com/jashkenas/coffeescript/issues/1731))
    - Generators ([coming very soon](https://github.com/jashkenas/coffeescript/issues/3073#issuecomment-71464718))

    @@ -168,7 +168,7 @@ All in all ES6 is a great leap forward for JavaScript and my huge thanks to all

    I still prefer CoffeeScript's syntax and find it very readable and concise - less code is less bugs - not to mention all its various helpers to make it easy for me to avoid common pitfalls for example safe null references with `object?.property` (rough JS equivalent: `typeof object !== 'undefined' && object !== null ? object.property : undefined`).

    Long live CoffeeScript and long live ES6!
    ### Long live CoffeeScript and long live ES6!

    [6to5]: https://6to5.org/
    [6to5's REPL]: https://6to5.org/repl/#?experimental=true&playground=true&evaluate=true&loose=false
  5. benjie revised this gist Jan 30, 2015. 1 changed file with 9 additions and 1 deletion.
    10 changes: 9 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -135,7 +135,15 @@ foo double, 80, 60, 40, (err, results) ->
    console.log results
    ```

    Sadly ES6 only allows splats at the end, requiring you to then manually `pop()` the callback (or lastName), making your code longer and more challenging to understand.
    Sadly ES6 only allows splats at the end, requiring you to then manually `pop()` the callback (or lastName), making your code longer and making you choose more variables names (and we all hate picking variable names right?):

    ```js
    var names = ["Alice", "Belinda", "Catherine", "Davidson"];
    var firstName, middleNames, lastName, rest;
    [firstName, ...rest] = names;
    lastName = rest.pop();
    middleNames = rest;
    ```

    Structuring/Destructuring
    -------------------------
  6. benjie revised this gist Jan 30, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -120,7 +120,7 @@ Another brilliant addition, but I find splats can be quite powerful in the middl

    ```coffee
    # Splat dereferencing
    names = ["Alice", "Belinda", "Catherine", "Davina", "Emma", "Francine", "Georgia", "Harriet", "Iglesias"]
    names = ["Alice", "Belinda", "Catherine", "Davidson"]
    [firstName, middleNames..., lastName] = names

    # Splat function args preserving callback
  7. benjie revised this gist Jan 30, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -22,7 +22,7 @@ class Person
    "Unidentified Person"

    blake = new Person "Blake", "Williams"
    blake.setName("Blake Anderson")
    blake.setName "Blake Anderson"
    console.log blake.name()
    ```

  8. benjie revised this gist Jan 30, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,7 @@ Clearly ES6 is a huge improvement over ES5, and tools like [6to5][] allow us to
    Classes
    -------

    Classes in ES6 (like many features in ES6) are very similar to the CoffeeScript equivalent. To support browsers that are not fully ES5 compliant (e.g. IE8-), however, we still can't really use getters/setters, so ignoring these the comparison is:
    Classes in ES6 (like many of the syntax changes in ES6) are very similar to the CoffeeScript equivalent. To support browsers that are not fully ES5 compliant (e.g. IE8-), however, we still can't really use getters/setters, so ignoring these the comparison is:

    ```coffee
    class Person
  9. benjie revised this gist Jan 30, 2015. 1 changed file with 9 additions and 0 deletions.
    9 changes: 9 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -153,6 +153,15 @@ It wouldn't be fair to try and paint CoffeeScript as a perfect language - it cer
    - Computed (dynamic) property names, `{[getKey()]: getValue()}` (see the links in [this StackOverflow answer](http://stackoverflow.com/a/13998890) for some [interesting](https://github.com/jashkenas/coffeescript/issues/786) [history](https://github.com/jashkenas/coffeescript/issues/1731))
    - Generators ([coming very soon](https://github.com/jashkenas/coffeescript/issues/3073#issuecomment-71464718))

    Conclusion
    ----------

    All in all ES6 is a great leap forward for JavaScript and my huge thanks to all the developers who have made this possible. Not mentioned above are many of the features that ES6 has added that don't involve syntax changes and hence CoffeeScript can use without changes, such as Proxies, WeakMaps and much more.

    I still prefer CoffeeScript's syntax and find it very readable and concise - less code is less bugs - not to mention all its various helpers to make it easy for me to avoid common pitfalls for example safe null references with `object?.property` (rough JS equivalent: `typeof object !== 'undefined' && object !== null ? object.property : undefined`).

    Long live CoffeeScript and long live ES6!

    [6to5]: https://6to5.org/
    [6to5's REPL]: https://6to5.org/repl/#?experimental=true&playground=true&evaluate=true&loose=false
    [replace coffeescript]: http://robots.thoughtbot.com/replace-coffeescript-with-es6
  10. benjie revised this gist Jan 30, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -62,7 +62,7 @@ Interpolation

    Clearly ES6's and CoffeeScript's string interpolations are very similar; CoffeeScript interpolates for normal `"strings"`, whereas ES6 uses `` `backtick escaped strings` `` (which are annoying to write in Markdown, by the way). CoffeeScript uses `#{var}` whereas ES6 uses `${var}`. All much of a muchness at this point.

    Where the difference really stands out is in the handling of whitespace - ES6 (or at least the 6to5 tool) includes all the whitespace between the \`'s (including newlines and indentation), whereas CoffeeScript either joins with a single space in the case of simple `"` strings or preserves all whitespace *accounting for indentation level* in the case of `"""` strings. To my mind both of these behaviours are desirable, whereas ES6's is not, take for example:
    Where the difference really stands out is in the handling of whitespace - ES6 (or at least the 6to5 tool) includes all the whitespace between the `` ` ``s (including newlines and indentation), whereas CoffeeScript either joins with a single space in the case of simple `"` strings or preserves all whitespace *accounting for indentation level* in the case of `"""` block strings. To my mind both of these behaviours are desirable, whereas ES6's is not, take for example:

    ```js
    (function() {
  11. benjie revised this gist Jan 30, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -60,7 +60,7 @@ That said, I much prefer CoffeeScript's implementation of `super`, though I can
    Interpolation
    -------------

    Clearly ES6's and CoffeeScript's string interpolations are very similar; CoffeeScript interpolates for normal `"string"`s, whereas ES6 uses `` `backtick escaped strings` `` (which are annoying to write in Markdown, by the way). CoffeeScript uses `#{var}` whereas ES6 uses `${var}`. All much of a muchness at this point.
    Clearly ES6's and CoffeeScript's string interpolations are very similar; CoffeeScript interpolates for normal `"strings"`, whereas ES6 uses `` `backtick escaped strings` `` (which are annoying to write in Markdown, by the way). CoffeeScript uses `#{var}` whereas ES6 uses `${var}`. All much of a muchness at this point.

    Where the difference really stands out is in the handling of whitespace - ES6 (or at least the 6to5 tool) includes all the whitespace between the \`'s (including newlines and indentation), whereas CoffeeScript either joins with a single space in the case of simple `"` strings or preserves all whitespace *accounting for indentation level* in the case of `"""` strings. To my mind both of these behaviours are desirable, whereas ES6's is not, take for example:

  12. benjie revised this gist Jan 30, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -60,7 +60,7 @@ That said, I much prefer CoffeeScript's implementation of `super`, though I can
    Interpolation
    -------------

    Clearly ES6's and CoffeeScript's string interpolations are very similar; CoffeeScript interpolates for normal `"string"`s, whereas ES6 uses `\`backtick escaped strings\`` (which are annoying to write in Markdown, by the way). CoffeeScript uses `#{var}` whereas ES6 uses `${var}`. All much of a muchness at this point.
    Clearly ES6's and CoffeeScript's string interpolations are very similar; CoffeeScript interpolates for normal `"string"`s, whereas ES6 uses `` `backtick escaped strings` `` (which are annoying to write in Markdown, by the way). CoffeeScript uses `#{var}` whereas ES6 uses `${var}`. All much of a muchness at this point.

    Where the difference really stands out is in the handling of whitespace - ES6 (or at least the 6to5 tool) includes all the whitespace between the \`'s (including newlines and indentation), whereas CoffeeScript either joins with a single space in the case of simple `"` strings or preserves all whitespace *accounting for indentation level* in the case of `"""` strings. To my mind both of these behaviours are desirable, whereas ES6's is not, take for example:

  13. benjie revised this gist Jan 30, 2015. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -53,9 +53,9 @@ blake.setName("Blake Anderson");
    console.log(blake.name());
    ```

    I definitely like the way this is headed - no need for commas, no need to write `function` all over the place; but I'm in the "write less code" camp, so I definitely prefer the former (not to mention finding it far more readable). However this is a matter of tast so if you're happy with typing `this.` instead of `@` and adding in all the extra curly brackets it definitely backs up Blake's statement that ES6 is a viable alternative.
    I definitely like the way this is headed - no need for commas, no need to write `function` all over the place; but I'm in the "write less code" camp, so I prefer the former. However this is really a matter of taste so if you're happy with typing `this.` instead of `@` and adding in all the extra curly brackets it definitely backs up Blake's statement that ES6 is a viable alternative.

    Further to this I much prefer CoffeeScript's implementation of `super`, though I can see why ES6 went the way they did allowing you to call a different method on the object's super.
    That said, I much prefer CoffeeScript's implementation of `super`, though I can see why ES6 went the way they did allowing you to call a different method on the object's super.

    Interpolation
    -------------
  14. benjie revised this gist Jan 30, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -155,5 +155,5 @@ It wouldn't be fair to try and paint CoffeeScript as a perfect language - it cer

    [6to5]: https://6to5.org/
    [6to5's REPL]: https://6to5.org/repl/#?experimental=true&playground=true&evaluate=true&loose=false
    [replacecoffeescript]: http://robots.thoughtbot.com/replace-coffeescript-with-es6
    [replace coffeescript]: http://robots.thoughtbot.com/replace-coffeescript-with-es6
    [Blake Williams]: https://twitter.com/blakewilliams__
  15. benjie revised this gist Jan 30, 2015. 1 changed file with 4 additions and 3 deletions.
    7 changes: 4 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -147,10 +147,11 @@ ES6 does object de/structuring pretty much the same as CoffeeScript (`var {a, b}
    Things ES6 has that I wish CoffeeScript had
    -------------------------------------------

    - The ternary operator `a ? b : c` (`if a then b else c` is too verbose for my taste)
    - Computed (dynamic) property names, `{[getKey()]: getValue()}`
    -
    It wouldn't be fair to try and paint CoffeeScript as a perfect language - it certainly is not without its faults. Here's a list of features from ES6 (and even ES3) that I really miss in CoffeeScript.

    - The ternary operator `a ? b : c` (`if a then b else c` is too verbose for my taste)
    - Computed (dynamic) property names, `{[getKey()]: getValue()}` (see the links in [this StackOverflow answer](http://stackoverflow.com/a/13998890) for some [interesting](https://github.com/jashkenas/coffeescript/issues/786) [history](https://github.com/jashkenas/coffeescript/issues/1731))
    - Generators ([coming very soon](https://github.com/jashkenas/coffeescript/issues/3073#issuecomment-71464718))

    [6to5]: https://6to5.org/
    [6to5's REPL]: https://6to5.org/repl/#?experimental=true&playground=true&evaluate=true&loose=false
  16. benjie revised this gist Jan 30, 2015. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -137,10 +137,12 @@ foo double, 80, 60, 40, (err, results) ->

    Sadly ES6 only allows splats at the end, requiring you to then manually `pop()` the callback (or lastName), making your code longer and more challenging to understand.

    Destructuring
    -------------
    Structuring/Destructuring
    -------------------------

    I must say I do like that ES6 lets you leave true blanks when doing `var [first, , last] = [1, 2, 3]` but using an underscore or similar is a one character workaround.

    I must say I do like that ES6 lets you leave true blanks when doing `var [first, , last] = [1, 2, 3]` but using an underscore or similar is a one character workaround.
    ES6 does object de/structuring pretty much the same as CoffeeScript (`var {a, b} = {a: 1, c:3}`, `var {foo: a, bar: b} = {foo: 1, baz: 3}` and `var c = {a, b}`) however there's a slight circumstance where CoffeeScript does it better: when referencing properties off of the current object, e.g. `c = {@a, @b}` (`var c = {a: this.a, b: this.b}`).

    Things ES6 has that I wish CoffeeScript had
    -------------------------------------------
  17. benjie revised this gist Jan 30, 2015. 1 changed file with 10 additions and 2 deletions.
    12 changes: 10 additions & 2 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -42,6 +42,7 @@ class Person {
    setName(name) {
    [this.firstName, this.lastName] = name.split(" ");
    }

    static defaultName() {
    return "Unidentified Person"
    }
    @@ -61,7 +62,7 @@ Interpolation

    Clearly ES6's and CoffeeScript's string interpolations are very similar; CoffeeScript interpolates for normal `"string"`s, whereas ES6 uses `\`backtick escaped strings\`` (which are annoying to write in Markdown, by the way). CoffeeScript uses `#{var}` whereas ES6 uses `${var}`. All much of a muchness at this point.

    Where the difference really stands out is in the handling of whitespace - ES6 includes all the whitespace between the \`'s (including newlines and indentation), whereas CoffeeScript either joins with a single space in the case of simple `"` strings or preserves all whitespace *accounting for indentation level* in the case of `"""` strings. To my mind both of these behaviours are desirable, whereas ES6's is not, take for example:
    Where the difference really stands out is in the handling of whitespace - ES6 (or at least the 6to5 tool) includes all the whitespace between the \`'s (including newlines and indentation), whereas CoffeeScript either joins with a single space in the case of simple `"` strings or preserves all whitespace *accounting for indentation level* in the case of `"""` strings. To my mind both of these behaviours are desirable, whereas ES6's is not, take for example:

    ```js
    (function() {
    @@ -105,7 +106,7 @@ var str = "This is quite a long first line so I wrap it to a second line and the
    var str2 = "This is quite a long first line\nso I wrap it to a second line and then\nappend the value " + val;
    ```

    I can't think of a situation where I'd prefer ES6's implementation.
    I can't think of a situation where I'd prefer 6to5's implementation.

    Fat Arrows, Default Arguments
    -----------------------------
    @@ -141,6 +142,13 @@ Destructuring

    I must say I do like that ES6 lets you leave true blanks when doing `var [first, , last] = [1, 2, 3]` but using an underscore or similar is a one character workaround.

    Things ES6 has that I wish CoffeeScript had
    -------------------------------------------

    - The ternary operator `a ? b : c` (`if a then b else c` is too verbose for my taste)
    - Computed (dynamic) property names, `{[getKey()]: getValue()}`
    -


    [6to5]: https://6to5.org/
    [6to5's REPL]: https://6to5.org/repl/#?experimental=true&playground=true&evaluate=true&loose=false
  18. benjie created this gist Jan 30, 2015.
    148 changes: 148 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,148 @@
    ES6 is cool, but CoffeeScript still does it better
    ==================================================

    Clearly ES6 is a huge improvement over ES5, and tools like [6to5][] allow us to use these cool features now. I was reading [Replace CoffeeScript with ES6][replace coffeescript] by [Blake Williams][] and thought it was a great summary of how ES6 solves many of the same problems that CoffeeScript solves; however I'd like to comment on a few of Blake's points.

    Classes
    -------

    Classes in ES6 (like many features in ES6) are very similar to the CoffeeScript equivalent. To support browsers that are not fully ES5 compliant (e.g. IE8-), however, we still can't really use getters/setters, so ignoring these the comparison is:

    ```coffee
    class Person
    constructor: (@firstName, @lastName) ->

    name: ->
    "#{@firstName} #{@lastName}"

    setName: (name) ->
    [@firstName, @lastName] = name.split " "

    @defaultName: ->
    "Unidentified Person"

    blake = new Person "Blake", "Williams"
    blake.setName("Blake Anderson")
    console.log blake.name()
    ```

    vs

    ```js
    class Person {
    constructor(firstName, lastName) {
    this.firstName = firstName;
    this.lastName = lastName;
    }

    name() {
    return `${this.firstName} ${this.lastName}`;
    }

    setName(name) {
    [this.firstName, this.lastName] = name.split(" ");
    }
    static defaultName() {
    return "Unidentified Person"
    }
    }

    var blake = new Person("Blake", "Williams");
    blake.setName("Blake Anderson");
    console.log(blake.name());
    ```

    I definitely like the way this is headed - no need for commas, no need to write `function` all over the place; but I'm in the "write less code" camp, so I definitely prefer the former (not to mention finding it far more readable). However this is a matter of tast so if you're happy with typing `this.` instead of `@` and adding in all the extra curly brackets it definitely backs up Blake's statement that ES6 is a viable alternative.

    Further to this I much prefer CoffeeScript's implementation of `super`, though I can see why ES6 went the way they did allowing you to call a different method on the object's super.

    Interpolation
    -------------

    Clearly ES6's and CoffeeScript's string interpolations are very similar; CoffeeScript interpolates for normal `"string"`s, whereas ES6 uses `\`backtick escaped strings\`` (which are annoying to write in Markdown, by the way). CoffeeScript uses `#{var}` whereas ES6 uses `${var}`. All much of a muchness at this point.

    Where the difference really stands out is in the handling of whitespace - ES6 includes all the whitespace between the \`'s (including newlines and indentation), whereas CoffeeScript either joins with a single space in the case of simple `"` strings or preserves all whitespace *accounting for indentation level* in the case of `"""` strings. To my mind both of these behaviours are desirable, whereas ES6's is not, take for example:

    ```js
    (function() {
    function foo(bar, val) {
    if (bar) {
    var str = `This is quite a long first line
    so I wrap it to a second line and then
    append the value ${val}`;
    }
    }
    })();
    ```

    The output from passing this through [6to5's REPL][] is:

    ```js
    var str = "This is quite a long first line\n so I wrap it to a second line and then\n append the value " + val;
    ```

    CoffeeScript equivalents:

    ```coffee
    do ->
    foo = (bar, val) ->
    if bar
    str = "This is quite a long first line
    so I wrap it to a second line and then
    append the value #{val}";
    str2 =
    """
    This is quite a long first line
    so I wrap it to a second line and then
    append the value #{val}
    """
    ```

    produce

    ```js
    var str = "This is quite a long first line so I wrap it to a second line and then append the value " + val;
    var str2 = "This is quite a long first line\nso I wrap it to a second line and then\nappend the value " + val;
    ```

    I can't think of a situation where I'd prefer ES6's implementation.

    Fat Arrows, Default Arguments
    -----------------------------

    Brilliant additions to the JS syntax, these behave the same as CoffeeScript's but with ever-so-slightly different syntax rules.

    Splats
    ------

    Another brilliant addition, but I find splats can be quite powerful in the middle of an argument list, particularly in Node.js-style callback situations so that the callback is automatically popped off the end. For example:

    ```coffee
    # Splat dereferencing
    names = ["Alice", "Belinda", "Catherine", "Davina", "Emma", "Francine", "Georgia", "Harriet", "Iglesias"]
    [firstName, middleNames..., lastName] = names

    # Splat function args preserving callback
    foo = (fn, args..., callback) ->
    results = (fn arg for arg in args)
    process.nextTick ->
    callback null, results

    double = (a) -> a * 2

    foo double, 80, 60, 40, (err, results) ->
    console.log results
    ```

    Sadly ES6 only allows splats at the end, requiring you to then manually `pop()` the callback (or lastName), making your code longer and more challenging to understand.

    Destructuring
    -------------

    I must say I do like that ES6 lets you leave true blanks when doing `var [first, , last] = [1, 2, 3]` but using an underscore or similar is a one character workaround.


    [6to5]: https://6to5.org/
    [6to5's REPL]: https://6to5.org/repl/#?experimental=true&playground=true&evaluate=true&loose=false
    [replacecoffeescript]: http://robots.thoughtbot.com/replace-coffeescript-with-es6
    [Blake Williams]: https://twitter.com/blakewilliams__