News for hackers. Stuff that matters.
Re:Regarding JavaScript trailing commas by hillsidefm on Friday April 08, 2016 @11:08PM (#11459688)
Controversies like the "trailing comma" strike me as evidence that JavaScript has superfluous syntax. The reason it even uses commas the way it does is that it started life as a lisp with (manager-mandated) Java-like syntax.

I happen to agree with the position that syntax that can be made implicit should be. CoffeeScript has done a good job of this. LiveScript has done an even better one. What are the arguments against using a syntactically cleaner language that compiles down to the exact same features?

Re:Regarding JavaScript trailing commas by exception_e on Friday April 08, 2016 @11:12PM (#11459703)
> Is there a good reason not to use a syntactically cleaner language ...

I find Coffeescript hard to read. Especially when dealing with nested callbacks (e.x.: when you have to nest, such as with Jasmine `describe` and `it` blocks for testing).

Here's an interesting thread on the "cons" of using Coffeescript: https://news.ycombinator.com/item?id=6527316

Re:Regarding JavaScript trailing commas by hillsidefm on Friday April 08, 2016 @11:17PM (#11459717)
Fair enough. Maybe CoffeeScript specifically isn't the answer. But the general idea of compiling neater languages into JavaScript strikes me as a better long-term solution than settling for its current syntactical warts, which are entirely historical accidents.

I do like ES6!

Re:Regarding JavaScript trailing commas by marcus_holmes on Saturday April 09, 2016 @12:00AM (#11459837)
I think ES6 is the solution. Evolve JS and remove the "warts" instead of introducing new variants.

I'm a big JS fan. I can't stand Coffeescript - it doesn't seem to add anything except changing the syntax to make it easier for Rubyists to understand. Which is fine, I guess, but feels like a personal preference. More like a text editor setting than something anyone should publish their code in.

Same for Typescript, to a certain extent, though I understand the heartfelt desire to have the compiler pick up some of the more common errors.

We run the risk of fragmenting the community by promoting CS and TS - better to evolve JS itself, which is what is happening and it's great.

TL;DR: kill Coffeescript and Typescript, evolve Javascript for the win!

Re:Regarding JavaScript trailing commas by exception_e on Friday April 08, 2016 @11:21PM (#11459734)
I agree. Language features such as async/await (ES7) are exciting.
Re:Regarding JavaScript trailing commas by ludamad on Saturday April 09, 2016 @12:56AM (#11459995)
I am excited by async/await but it makes code non-trivially harder to debug. The tools are far from there
Re:Regarding JavaScript trailing commas by spriggan3 on Friday April 08, 2016 @11:54PM (#11459819)
> CoffeeScript has done a good job of this

And that language shouldn't be used by beginners in 2016 due to its uncertain fate in the long run as its creator kind of abandoned the project. Furhtermore ES2015 adds many CS features to the language.

Don't know about LiveScript, but frankly that whole transpilation thing is a mess. People don't use Transpilers for Python or Ruby. They work with the language quirks.

Re:Regarding JavaScript trailing commas by jacobolus on Saturday April 09, 2016 @01:45AM (#11460128)
Some of the features of ES6 are pretty neat. Some of them are just crap piled on crap, which bloat out the language for marginal benefits at best.

Unfortunately, many of the ES6 features inspired by CoffeeScript features are completely unoptimized and an order of magnitude slower in cutting-edge browsers than the CoffeeScript versions. Even more unfortunately, they don’t work at all in lots of browser versions people are still using today. Which means that they can’t really be adopted by most projects yet.

Finally, even if ES6 were implemented perfectly everywhere, it’s still much less pleasant (from a syntax clarity perspective) to read and write ES6 code than CoffeeScript code, at least for me.

At the point when the vast majority of browsers support ES6 features, it will perhaps be reasonable to change CoffeeScript to use them in its generated output. In the mean time, CS is fantastic as-is, and its generated code works efficiently in every browser.

But hey, use whatever language you like (ClojureScript, Elm, Dart, Haxe, ES6, whatever..). It’s your code, so the only people who should care are you and your close collaborators.

Re:Regarding JavaScript trailing commas by nostrademons on Saturday April 09, 2016 @02:22AM (#11460180)
So use Babel, as long as you're using a compiler anyway?
Re:Regarding JavaScript trailing commas by jacobolus on Saturday April 09, 2016 @02:40AM (#11460242)
Not my personal cup of tea (I don’t particularly like the ES6 syntax, and as I mentioned many of the nicer features are horribly inefficient in current browsers), but use whatever you like!