Hacker News new | ask | show | jobs
by otikik 969 days ago
Less diff noise when adding/removing lines in a commit.

If you put the comma at the end, and then you need to add a line, you either:

* Insert the new item "in the middle" of the list. This is often possible, but not always.

* Add the new item to the end of the list, in which case the the line that was at the end before will now need to be modified to add a line.

Lines that begin with the coma can be more easily moved around/resorted. With the comma at the end, if you put the "last" item in the middle, you also need to add a comma at its end (and remove the comma from the new item that is now the final one).

Personally, I like languages where you can simply leave a comma at the end of a list or enumeration without this being deemed a syntax error (for example, in Lua the table {1,2,3,} is equivalent to {1,2,3} )