Hacker News new | past | comments | ask | show | jobs | submit login

How so?



Inserting a new element with comma-first changes 2 lines:

   - { old-one
   + { new-one
   + , old-one
While trailing commas allow you to insert an element anywhere with just one line addition.

This doesn't break anything, but it makes looking at "git blame" so much easier.


This is only true if you insert at the head. And it's not really leading comma placement but the choice to put the first element in the line with the brace that is the culprit, though both are typical of comma-first.


With separating comma, it either affects the first or the last position, depending on where you put the commas. But those are the most common places you modify lists.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: