Replace CoffeeScript with ES6
31–40 of 178 posts
Re: Replace CoffeeScript with ES6
#32Earlier quoted context omitted.
I'm not sure that's a convincing argument – you will in almost every conceivable case have a build pipeline in place anyway, so there's not really a cost there.
I don't set up a "build pipeline" until I'm sure the app is going to deployed to a production environment. Why would I set up a build for what is essentially a fiddle, or if I'm just experimenting? The now-common workflow where people write build scripts at the start of a new project is just bizarre to me.
Re: Replace CoffeeScript with ES6
#33Earlier quoted context omitted.
Do you have a source? I don't understand how a closure over a single variable (this), instead of reassigning the value of the variable in a specific scope, would result in a 50% improvement in performance. Also -- the phrase "50% improvement in performance" itself is kind of dubious, no?
I wrote a simple benchmark, and `bind` seems to be mind-boggling slow. http://jsperf.com/self-this-vs-bind
Re: Replace CoffeeScript with ES6
#34Re: Replace CoffeeScript with ES6
#35Classes:
There is no semicolon after the function name
The function keyword is omitted
There are no commas after each definition
Interpolation: `${1 + 1}`
Multi line strings: ` Now we have a 3rd
string delimiter`
Fat arrow: $("button").on("click", () => {
// really? hanging parens? no function keyword?
});
Destructuring: var [first, , last] = [1, 2, 3]
// thats a var to assign vals inside an array
// and just two commas touching to ignore a value
The whole post is about drastic syntax changes. The brackets are optional in coffeescript.Besides coffeescript is just a tool.
Re: Replace CoffeeScript with ES6
#36Re: Replace CoffeeScript with ES6
#37Why not both? This makes a good argument for ES6, but CoffeeScript's fundamental changes to syntax are just preferred by some.
Some reasons why I will stick with CS: * Optional braces and parenthesis. Results in visually cleaner and more compact code, especially when dealing with large objects. * Requiring backticks to do string interpolation seems like an ugly hack. * CS uses dots to slice and splice ranges: host?.split(".")[-1..][0] == "dns" BTW, notice in the example above two additional CS features that don't exist in ES6: * The existent…
Re: Replace CoffeeScript with ES6
#38I wonder if ES6+ is going to become the new HTML5 - all these great features but no hope of proper browser support for years. I had no idea ES7 was also in development, so it seems like browsers are always going to be playing catchup. The comments on an article here the other day said people aren't upgrading tablets as often as phones. I can see a lot of tablets being stuck on ES5, that people don't want to upgrade,…
http://kangax.github.io/compat-table/es6/
The main laggard for now is Safari/WebKit.
Re: Replace CoffeeScript with ES6
#39Re: Replace CoffeeScript with ES6
#40Why not both? This makes a good argument for ES6, but CoffeeScript's fundamental changes to syntax are just preferred by some.
Some reasons why I will stick with CS: * Optional braces and parenthesis. Results in visually cleaner and more compact code, especially when dealing with large objects. * Requiring backticks to do string interpolation seems like an ugly hack. * CS uses dots to slice and splice ranges: host?.split(".")[-1..][0] == "dns" BTW, notice in the example above two additional CS features that don't exist in ES6: * The existent…