Re:Delimiter-first code
by dspillett on Friday December 09, 2022 @07:33AM
(#33920541)
I tend to use that sort of layout, particularly the comma-first example shown in the article for SQL and JSON. It makes moving things around less error prone (no need to worry about where the ; is then you reorder or add to or remove from the end of a list) and makes diffs cleaner between versions for the same reason. And I feel it just seems clearer. Some people seem to hate it with a passion though.
[ Parent
| on HN ]
Re:Delimiter-first code
by TrianguloY on Friday December 09, 2022 @05:58PM
(#33927562)
The issue with that layout (and with my examples) is that the first element is the odd one, and you can't reorder it. I think it's better this way (usually the first different is special, and also you usually add things at the end) but I prefer a trailing comma over the comma at the left. A leading comma, like the article discuss, would be an nice addition indeed