Live data from Hacker News

Replace CoffeeScript with ES6

robots.thoughtbot.com

51–60 of 178 posts

Re: Replace CoffeeScript with ES6

#51

Mmmm without drastic syntax changes ? Classes: 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 va…

> why not just # like everyone else?

You mean like CS? '#' actually isn't a very popular choice for this.

http://en.wikipedia.org/wiki/String_interpolation

Re: Replace CoffeeScript with ES6

#52

The reason that I like CoffeeScript is that it removes, what I consider, the unnecessary boilerplate of JavaScript and replaces it with a shorthand equivalent and good conventions. I feel that CoffeeScript is better at representing the intent of JS than JS. I can visually sift through CoffeeScript and understand the code much quicker than normal JavaScript, which in my opinion leads to more maintainable code. I'm not…

The things I hate most about CoffeeScript are the dash rockets and white-space significance. These are just opinions though. There are things I like about CS as well, like destructuring assignment and splats. Sometimes when I'm writing JS, I miss is, unless, etc... That said, I'd put my money on ES6 in the long run, though it doesn't really matter. People should use whatever makes them (and their team) happy and productive.

Re: Replace CoffeeScript with ES6

#54
post #2

Why not both? This makes a good argument for ES6, but CoffeeScript's fundamental changes to syntax are just preferred by some.

Because one day ES6 will run in browsers without a build step.

Yeah but then we'll just be compiling our ES8 code with 8to6.

Re: Replace CoffeeScript with ES6

#55

I 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,…

Most of the JavaScript community is already using this, thanks to tools like https://6to5.org/.

Developers are excited about new language features not because of browser support, but because it standardizes patterns they were already using (fat arrow functions, Promises, modules, classes, etc.) through CoffeeScript and third-party code.

Re: Replace CoffeeScript with ES6

#56

I 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,…

And the beauty of using ES6 is when the browsers you need to support handle, you just remove the transpiling step.

Re: Replace CoffeeScript with ES6

#57

I 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,…

Firefox and IE11 already natively implement a majority of new ES6 features, and Chrome is getting there: http://kangax.github.io/compat-table/es6/ The main laggard for now is Safari/WebKit.

Current stable browser versions:

FF 35: 60% Chrome 40: 35% Safari 8/Mobile: 22% IE11: 21%

Re: Replace CoffeeScript with ES6

#58
What CoffeeScript did was lodge the idea in people's heads that JavaScript can be treated as an assembly language to compile higher-level languages into. I'll bet many programmers' attitudes toward ES6 are: someone will write a compiler for my language, and I'll just use that.

It seems better to treat JavaScript as admittedly not being the most powerful language in the world, and to treat the standard as a kind of RFC that only compiler writers have to think about. For most programmers it works to just use CoffeeScript (or Lisp or anything) without worrying about standards, just as JavaScript programmers don't need to worry about how their processor works.

Re: Replace CoffeeScript with ES6

#60
post #51

Mmmm without drastic syntax changes ? Classes: 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 va…

> why not just # like everyone else? You mean like CS? '#' actually isn't a very popular choice for this. http://en.wikipedia.org/wiki/String_interpolation

Coffeescript's origin is in the Ruby community. The first interpreter was also written in Ruby. Ruby interpolates strings with #{} so that was a logical choice for Coffeescript.

The significant spaces thing was ironic given that Python is kind of the biggest competitor of Ruby (×) in the modern scripting languages space. Personally it's the main reason I'm not using CS (or Python or HAML or Slim), transpiling is number 2.

(×) kind of because Ruby is probably more successful in web development but less anywhere else.

Post reply on HN