Live data from Hacker News

Replace CoffeeScript with ES6

robots.thoughtbot.com

61–70 of 178 posts

Re: Replace CoffeeScript with ES6

#61
post #7

I give credit to CoffeeScript with really helping to push the ES specs forward and think it helped introduce more people to JS and grow the ecosystem. Heck, I used it for a year, liked it, and had it change some of my approaches to writing JS. That said, I hope it slowly fades into the background as more people go back to vanilla ES6 or go with something more powerful such as TypeScript (or Flux). With the progress a…

I sure hope you're wrong. The unnecessary clutter of plain JS is just painful to look at. I can't remember how many times I've looked over a 40 line block of JS searching for a missing. When there are many )} )}; } ; } ; } -- it is just downright frustrating to be be wasting any time on what is effectively irrelevant syntax. With CS, it's indent and be done with it. It's like SASS vs. SCSS. Or Haml vs. ERB. I can't, for the life of me figure out why anyone would prefer more to less. To take Haml as an example:

.my-div %h1 Some Text - some_ruby_code

vs the ERB of

Some Text

Re: Replace CoffeeScript with ES6

#62

ES6 has 'let', while CoffeeScript has an '=' that might be local binding and might be nonlocal assignment, depending on what's in scope. I wanted to like CS, but I don't want to live with that one decision.

The scoping issues with CoffeeScript is what triggered me creating this little language: http://batiste.info/CokeScript/ At this point it still a bit of a joke, but if I have more time to work on it I could take to a usable state.

Re: Replace CoffeeScript with ES6

#63
post #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 annoy…

[deleted]

Re: Replace CoffeeScript with ES6

#64
post #3

Yes and no. Although we get some fantastic features, one of the most critical- the ability to neglect parens and curly braces- is lost in es6. I'm working on an es6 project right now and still prefer coffeescript.

For functions of single arguments, you parameter list parens are optional. But it's not an objective fact that coffeescript's syntax is better. I prefer ES6. And even if you prefer coffeescript, it seems strange to claim that the most critical feature is purely aesthetic.

Assuming it's all ultimately JS, the aesthetic side is a big deal. It results in an easier time understanding and being able to debug the code, which is a huge, perhaps underestimated win.

Re: Replace CoffeeScript with ES6

#66

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…

I love coffeescript, but it seems like the source maps are still pretty garbage. I often have to turn source maps off just to make Chrome's debugger not act so crazy. When I click to place a breakpoint in the original coffeescript code, it'll show up somewhere pages off from where it should go, and it just won't let me put breakpoints at certain lines.

Re: Replace CoffeeScript with ES6

#67

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

Significant indentation is a good thing. Haskell and Python do it too.

It's much easier to read indentation than it is to match up pairs of brackets in your head. In other languages, if the indentation doesn't match the brackets, you'll naturally read the indentation first and get the wrong impression of what the code does. In those languages, the indentation is supposed to match the brackets anyway. Why be redundant like that?

Re: Replace CoffeeScript with ES6

#68

The biggest reason why I still dont use coffeescript is that most compile javascript tooling doesnt work. I cant use types from TypeScript, or use JSX extentions with coffeescript.

You can use coffee-script with JSX. I'm using cjsx-loader with webpack, and there's also a stand-alone cjsx compiler.

https://github.com/jsdf/coffee-react

https://github.com/KyleAMathews/cjsx-loader

Re: Replace CoffeeScript with ES6

#69
post #60
post #51

Earlier quoted context omitted.

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

I don't understand why significant indentation is a bad thing. It's easier to read indentation than it is to try and match brackets in your head.

The only times it bites me is when I accidentally mix spaces and tabs in the same block, which could use a warning.

Post reply on HN