22 ms·
Only tangentially related (but hey, it's HN) - I'm so happy about the support/requirements for trailing commas in the modern language syntax: x = [ 1
by t0mek 6mo ago
Only tangentially related (but hey, it's HN) - I'm so happy about the support/requirements for trailing commas in the modern language syntax:
x = [
123,
456,
789,
];
It makes editing such a list so much easier. Also, the commit diffs are cleaner (you don't need to add comma to the last element when appending a new one).
- Izkata 6mo agoMy very first programming language doesn't use commas: x: [ 123 456 789 ]
- echohack5 6mo agoThe oxford comma debate is so annoying because it clearly has nothing but advantages. Removing commas from a delimited list does nothing to resolve ambiguity, whether lexicographically or syntactically. It's so useful as a delimiter and anti-ambiguity machine, that you don't even need spaces for it to work! See CSV or Japanese.
- mmooss 6mo ago> The oxford comma debate is so annoying because it clearly has nothing but advantages. .. if you care only about data communication and have no sense of beauty, aesthetics, rhythm or personality in writing.
- black_knight 6mo agoI like this: x = [ 123 , 456 , 789 ]
- tommy_axle 6mo agoNah, prepending will lead to a messier diff than the parent example.
- deleted 6mo ago[deleted]