[Bug 17508] Let enum lists end with a comma

https://www.w3.org/Bugs/Public/show_bug.cgi?id=17508

Nils Barth <nbarth+w3bugzilla@google.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nbarth+w3bugzilla@google.co
                   |                            |m

--- Comment #5 from Nils Barth <nbarth+w3bugzilla@google.com> ---
I've opened a more general and detailed bug here:
Bug 22156 - Allow trailing commas in Web IDL lists

To address your concerns Cameron, I think this is primarily about vertical
lists and computer-generated lists, and secondarily about individual tastes.

I agree that the horizontal list {"foo", "bar",} is pretty ugly,
but OTOH in a vertical list, the form with trailing commas:
{
  "foo",
  "bar",
}
...looks clearer than the form without:
{
  "foo",
  "bar"
}
...and it's easier to edit when there are trailing commas (since don't need to
add or remove when last element changes or moves).

It's also of course easier to generate for computer output or pretty-printing,
since you don't need to special-case the last element, and as discussed in Bug
22156, trailing commas allow clearer diffs, and not allowing trailing commas is
a comma source of syntax errors. Further many parsers allow trailing commas
anyway (notably non-IE ES3 parsers -- a common cause of errors there -- and
existing Blink IDL parser, which I'm in the middle of fixing). Also some
developers really prefer trailing commas (for varied personal reasons).

So allowing trailing commas sounds like it would avoid a holy war
(accommodating either style), avoid errors, and save developer time worrying
about this -- it's a very easy mistake to make, so making the grammar more
robust seems advisable.

What do you think?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Friday, 24 May 2013 06:50:19 UTC