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 9 months ago by canpolat@programming.dev to programming@programming.dev
https://devblogs.microsoft.com/oldnewthing/20240209-00/?p=109379
Comments
lolcatnip@reddthat.com 9 months ago
xmunk@sh.itjust.works 9 months ago
SQL needs more trailing commas so fucking badly.
Isoprenoid@programming.dev 9 months ago
TLDR:
Trailing commas for lists allow easier: