boon or bane?

3 views
Skip to first unread message

Raoul Duke

unread,
Jan 9, 2022, 8:46:47 PM1/9/22
to pi...@googlegroups.com
trailing commas?

Mike Austin

unread,
Jan 11, 2022, 11:11:30 AM1/11/22
to PiLuD
In React I use them now, and with eslint that can be inserted automatically on save in VS Code. Merges are less annoying, and you get used to the syntax.

In Kopi, tuple and array expression on separate lines are simply separated by the newline. This is very handy, since you can write full expressions per line. The drawback is that it's something to learn.

Then there's LISPy languages that don't use commas, so separating by newlines comes free. But I like my commas in tuples and arrays.

On Sunday, January 9, 2022 at 5:46:47 PM UTC-8 raould wrote:
trailing commas?

David Barbour

unread,
Jan 11, 2022, 5:54:10 PM1/11/22
to pi...@googlegroups.com
If trailing commas aren't an option, I'll often use prefix commas in vertically arranged lists such that adding an item does not require modifying the lines above or below.

[ a
, b
, c
]

Similar for semicolons. Trailing commas can be convenient when writing and editing lots of lists.  YMMV. 

That said, I'd prefer to avoid these entirely. In Clojure, IIRC, commas are just treated as whitespace and they rely instead upon parsing individual values in the list. In F#, you only need explicit semicolons to separate list elements on the same line; for vertical lists, significant whitespace is used.


On Sun, Jan 9, 2022 at 7:46 PM Raoul Duke <rao...@gmail.com> wrote:
trailing commas?

--
You received this message because you are subscribed to the Google Groups "PiLuD" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pilud+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pilud/CAJ7XQb6-B5gp04PzKS%3DZG4FRxV7hS3XBND6ghWRuJmY-TzDZ2g%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages