Hacker News new | ask | show | jobs
by icebraining 3282 days ago
My aversion has to do with the fact that the first element doesn't have one. The irregularity is annoying not just aesthetically, but also if you want to swap lines around, etc.
1 comments

But there's always a line without a comma -- comma-last has it on the last line instead of the first. So you can have the same line-swapping problem in either arrangement. Comma first just makes it easier to spot.
But there's always a line without a comma -- comma-last has it on the last line instead of the first.

Not if the language allows trailing commas on the last line, like Python and Go do.

Not if you allow dangling commas (trailing commas as the sibling comment calls them, I think it's the more generic term)...

Then you have a comma at the end in ALL lines, including the last one, without an issue. That was what I proposed above (and lots of languages do it, I think JS is adding it too).