11 ms·
Depending on the context, yes. But sometimes you are not allowed the last comma. ETA: Let me expand on why it's important to put the comma first. Which list is
by jeffbee 5y ago
Depending on the context, yes. But sometimes you are not allowed the last comma.
ETA: Let me expand on why it's important to put the comma first. Which list is more clear to you:
a
, dog
, weather
, banana
, b
, car
or
a,
dog,
weather,
banana,
b,
car
With the leading commas, they all line up, and you can see them in a neat little row. I really prefer it especially in contexts where the trailing comma is not permitted, such as a SQL query:
SELECT
name
, date
, operation
FROM
stuff