5 ms·
Ask HN: Shall we use Coffeescript or ES6?
we build a new project with nodejs. we love the coffeescript syntax but seams like ES6 has a lot to offer as well.
what should we use?
- n17r4m 11y agoLivescript - http://livescript.net http://livescript.net
- naturalethic 11y ago+1 your microscopically sized comment
- jessaustin 11y agoIf you love coffeescript syntax, ISTM you'll be happier in coffeescript. That isn't to take anything away from ES6, but coffeescript is just as capable, and your aesthetic preferences are more valid for you than anyone else's would be.
- deleted 11y ago[deleted]
- alexfreska 11y agoES6 is quickly becoming the norm and now with Babel there is no reason not to embrace the future. https://babeljs.io/ https://babeljs.io/
- deleted 11y ago[deleted]
- deleted 11y ago[deleted]
- danopilus 11y agoYou 'shell' choose for yourselves?
- citrusx 11y agoUse CoffeeScript. Even after all the work that TC39 put into ES6/ES2015, it's still not nearly as well done or helpful as CoffeeScript is. You'll be going against all of the "cool kids" by rejecting ES6, but you'll also be much more productive and happier.
- ryanthejuggler 11y agoHonestly, ES6 offers many of the advantages of Coffeescript (arrow functions, destructuring, etc.) and has the advantage of being a standard that will soon be natively understood by browsers, is fully backwards-compatible with ES5 (and therefore widely understood by developers), and also has a lot of IDE support and tooling available.
- cnp 11y agoWith Babel you can always be sure you're on top of things, with experimental stages being available to the user for testing future language proposals (ES7, ES8, ES20) and a to-die-for plugin architecture. ES6 has become pretty minimal --not as minimal as CoffeeScript, but getting there, with things like: let { destructured, vars } = myObject let foo = (num) => num * 2 class Foo extends Bar { constructor() { this.callFoo() } callFoo() { // Note the simple syntax } } Also, remember: no need for semicolons, but be aware when they can hang you up! (IIFE's, etc).
- weatherlight 11y agoAre there plans to make coffeescript ES6 compatible?
- jessaustin 11y agoIt already is, in that any ES6 interpreter can run the javascript that coffeescript produces. Perhaps you mean to ask whether there are plans for generated code to use ES6 features? Before ES6 is universal, that would set up a more complicated build chain (before we used coffeescript; now we have to use both coffeescript and babel). Also there is no point. Everything ES6 can do, can already be done in coffeescript.
- serve_yay 11y agoMy team uses ES6, today, with Babel. Recommended.
- fibo 11y agoThere is more than a way to do it. Coffeescript is a nice language, it can be a good choice, depending on the task (for example, atom is written with CoffeeSCript). And don't forget it "is simple JavaScript", you can mix both. ES6 on the other hand will be a great improvement. I am sure CoffeScript will evolve the transpiler to target ES6 too.
- je42 11y agoES6.
- vilmosi 11y agoAnswer is simple: ES6
- honest_joe 11y agoI would say ES6 for anything that will be worked on by more than 2 people. CoffeeScript for one man show projects. But honestly...ES6 will be the norm and you should know it anyway. So the question is..If you already know CoffeeScript should you keep using it ? The answer is YES ! If that makes you happy why not. But keep an eye on ES6 and learn it. More delicate question would be. If i start with JS should i learn ES6 or CoffeeScript first ?
- sagivo 11y agoCoffeeScript for one man show projects. what? why? we are a team of 8 working with it and it's great.
- seaneking 11y agoAnother vote for ES6 - it covers the most important fixes from coffeescript and is the next standard, so you're not writing in a DSL (don't have to worry about it going out of fashion, wider talent-pool in the future, etc.). And with Babel you can use it now and just transpile back to ES5.
- borplk 11y agoES6 and compile with Babel (I've tried every possible combination that you can name, and settled with that as the best choice)