Regarding JavaScript trailing commas
dontkry.com
Regarding JavaScript trailing commas
1–10 of 48 posts
Re: Regarding JavaScript trailing commas
#2I 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
#3Controversies 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 again…
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
#4Perhaps I'm just a lazy bastard, but it makes cut & paste a lot easier.
Re: Regarding JavaScript trailing commas
#5Controversies 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 again…
> 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
I do like ES6!
Re: Regarding JavaScript trailing commas
#6Re: Regarding JavaScript trailing commas
#7Earlier quoted context omitted.
> 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
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
#8I'm a Python programmer. In Python, trailing comma are idiomatic, so I welcome this. Perhaps I'm just a lazy bastard, but it makes cut & paste a lot easier.
I'd love to start using trailing commas in JS, but I've definitely had syntax error problems and unparsable JSON from them existing in recent memory.
Re: Regarding JavaScript trailing commas
#9If you use babel, you can write your source with trailing commas, then let the build step remove them for older browsers.
Re: Regarding JavaScript trailing commas
#10I'm a Python programmer. In Python, trailing comma are idiomatic, so I welcome this. Perhaps I'm just a lazy bastard, but it makes cut & paste a lot easier.
Same with PHP. I'd love to start using trailing commas in JS, but I've definitely had syntax error problems and unparsable JSON from them existing in recent memory.