News for hackers. Stuff that matters.
Re:Best Practices Exist For A Reason by ralesk on Wednesday May 02, 2012 @05:20PM (#3921253)
With a decent language that allows trailing commas (eg. everything other than JS or SQL), it would never have been a problem in the first place.
Re:Best Practices Exist For A Reason by btilly on Wednesday May 02, 2012 @05:31PM (#3921312)
Actually JS does allow trailing commas. Read the spec.

It is an IE bug that causes it to break. One of the many ways they do not follow the spec.

Re:Best Practices Exist For A Reason by damncabbage on Wednesday May 02, 2012 @11:23PM (#3922235)
It's the other way around. It was illegal in ECMAScript 3, which is what IE 8 and below (at the very least) implement:

  ObjectLiteral : 
      { } 
      { PropertyNameAndValueList } 

With ECMAScript 5 it is legal:

  ObjectLiteral : 
      { } 
      { PropertyNameAndValueList } 
      { PropertyNameAndValueList , } 

So before v5, the other browsers were incorrectly tolerating something that goes against the spec. It's only semi-recently that it's been "allowed" as a valid practice.
Re:Best Practices Exist For A Reason by bentlegen on Wednesday May 02, 2012 @05:33PM (#3921325)
Trailing commas is defined in ECMAScript 5. The issue is that IE8 and earlier choke on them.
Re:Best Practices Exist For A Reason by ralesk on Wednesday May 02, 2012 @06:39PM (#3921552)
Isn't ES5 only supported since IE9?

Not to mention, IE8 was released half a year before ES5 (according to a quick check on Wikipedia). So yes, pre-ES5 I'd say it's a normal thing to do not to allow trailing commas.

Re:Best Practices Exist For A Reason by bentlegen on Wednesday May 02, 2012 @06:52PM (#3921599)
I think if you re-read my comment, you'll find I'm saying the same thing.