3 ms·
> personal opinion I take it you didn't read my original comment? Also I disagree, dangling comma is a visual cue that the sequence has a continuation.
by keymone 9y ago
> personal opinion
I take it you didn't read my original comment?
Also I disagree, dangling comma is a visual cue that the sequence has a continuation.
- coldtea 9y ago>Also I disagree, dangling comma is a visual cue that the sequence has a continuation We already have a mechanism for telling whether a sequence ends or not -- the opening and closing bracket for the sequence. No need to have a second redundant one. This way the last element is an ordinary part of the sequence as any other and doesn't need a special exception to its formatting like the omission of the comma. Besides the point is moot as the "dangling" comma is already part of the JS standard.
- keymone 9y agoYou're talking about syntactic rules, I'm talking about visual cues. IMO there is no reason to have commas at all so this discussion is pointless.
- coldtea 9y ago>You're talking about syntactic rules, I'm talking about visual cues. In what way is ] also not a visual cue?
- keymone 9y agoIn what world having multiple cues with opposite meanings is considered good?
- coldtea 9y agoIn what world is the "," at the end of the final line an "opposite meaning" to ]? Not on modern JS world, which allows for dangling , everywhere: http://2ality.com/2013/07/trailing-commas.html http://2ality.com/2013/07/trailing-commas.html, so having a "," doesn't mean the line is not the last one anymore, just means "it's a line like any other". It's time JSON gets up with the times -- especially since it's a totally backwards compatible improvement.
- keymone 9y ago> it's a line like any other yeah, in other words - there should be no commas whatsoever. Weren't you the one complaining about redundancy?