Commas aren’t the only thing that need similar treatment. For example, Typescript allows a leading |
for union types, and for union types split across multiple lines, the result is so much easier to format compared to the equivalent code in, say, Haskell.
On the virtues of the trailing comma
Submitted 1 year ago by canpolat@programming.dev to programming@programming.dev
https://devblogs.microsoft.com/oldnewthing/20240209-00/?p=109379
Comments
lolcatnip@reddthat.com 1 year ago
xmunk@sh.itjust.works 1 year ago
SQL needs more trailing commas so fucking badly.
Isoprenoid@programming.dev 1 year ago
TLDR:
Trailing commas for lists allow easier: