Live data from Hacker News

Replace CoffeeScript with ES6

robots.thoughtbot.com

41–50 of 178 posts

Re: Replace CoffeeScript with ES6

#41
post #14

Earlier quoted context omitted.

It's also possible folks will continue forking and improving CoffeeScript so that it keeps up with future releases of vanilla js (which is actually what I hope will continue to happen). Folks like me who come from a Ruby / Python background really don't like brackets and declaring variables, so things like Coffeescript, LiveScript, CoCo, etc. are wonderful tools even despite their occasional moments of weakness. That…

I almost feel like the coffeescript variants are where the action is.

Care to list some? I'm always interested in seeing what's out there

Re: Replace CoffeeScript with ES6

#42
post #2

Why 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…

I wonder if CS will evolve further now that ES6 is about to land.

Re: Replace CoffeeScript with ES6

#45

Earlier quoted context omitted.

I almost feel like the coffeescript variants are where the action is.

Care to list some? I'm always interested in seeing what's out there

The big one is probably LiveScript. I feel like it removes some of CoffeeScripts rough edges (the big one is the scoping rules; in LiveScript you have to use := to modify a variable in in outer scope).

Re: Replace CoffeeScript with ES6

#46

Is there a preprocessor/transpiler that lets you write vanilla ES6 but just without brackets, semi-colons, etc. like CoffeeScript?

Semicolons are already optional in JS. Automatic semi colon insertion (ASI) has a clear set of rules that are pretty easy to remember.

http://mattdesl.svbtle.com/to-semicolon-or-not

Re: Replace CoffeeScript with ES6

#48

  it solves a lot of the problems that CoffeeScript is trying to solve without drastic syntax changes.
I cannot speak to authorial intent, but for me the majority of the problems CoffeeScript(and moreso LiveScript) solves are syntax ones.

Re: Replace CoffeeScript with ES6

#49

Is there a preprocessor/transpiler that lets you write vanilla ES6 but just without brackets, semi-colons, etc. like CoffeeScript?

Semicolons are already optional in JS. Automatic semi colon insertion (ASI) has a clear set of rules that are pretty easy to remember. http://mattdesl.svbtle.com/to-semicolon-or-not

But ASI is controversial, because of the bugs that can be caused by it. (See "JavaScript, the Good Parts"). I make our devs (myself include) use semicolons with jshint, because I believe it's too easy to screw up.

Re: Replace CoffeeScript with ES6

#50

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…

My biggest problem is definitely the source maps. It took me forever to get them to "work" and while the stack traces are mostly correct, they're often off by a line number or two. This makes debugging ridiculously hard when the line numbers are just "close".

I know this might not sound like a big deal in the grand scheme of things, but I also don't think CoffeeScript really improves on js all that much, so the annoyances of source maps are just not worth it to me personally.

Post reply on HN