[swift-evolution] Allowing trailing commas in argument lists

Erica Sadun erica at ericasadun.com
Thu Mar 10 14:27:05 CST 2016


>>> On 10 Mar 2016, at 17:28, Radosław Pietruszewski <radexpl at gmail.com <mailto:radexpl at gmail.com>> wrote:
>>> 
>>> Trailing comma is not nonsensical, there is a specific purpose in allowing it (unlike your examples), and there’s precedent in Swift already.
>>> 

Trailing commas enable easier re-ordering of arguments, simplify growing or compacting argument lists, and do no harm.

Their use in arrays and dictionaries are conventional enough that experienced programmers will not be surprised by their
presence. No one will force their use and one's internal style guide (and linters) can direct whether any individual group
adopts or ignores the addition.

For those of us who prefer trailing commas, it will be both a convenience and an asset. For those against, there's no harm
done. I find it unlikely that trailing commas will naturally lead to any unsafe code or produce a net negative effect on the
language or the code-base it supports.

-- Erica


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160310/630eba82/attachment.html>


More information about the swift-evolution mailing list