[swift-evolution] Allowing trailing commas in argument lists

Radosław Pietruszewski radexpl at gmail.com
Thu Mar 10 15:29:53 CST 2016


> In working with many programming languages since
> ca. 1980, there was not even one language offering this, 
> and I am an experienced programmer. 

Ruby, JavaScript, CoffeeScript, Swift.

— Radek

> On 10 Mar 2016, at 22:16, Ted F.A. van Gaalen via swift-evolution <swift-evolution at swift.org> wrote:
> 
> H Erica.
> 
> In working with many programming languages since
> ca. 1980, there was not even one language offering this, 
> and I am an experienced programmer. 
> 
> What do you mean with “reordering”  in this context? 
>   1. only with manually editing  ?
> or
>   2.  With some form of source automation ?
> or 
>   3. reason(s) unknown to me? 
> 
> 
> Btw. please note that Swift should also be accessible and usable for less experienced programmers.
> 
> Sorry, Erica, another topic, but if in what you wrote here you'd replace “trailing commas”  with    “for ; ;”  you would have described exactly
> my opinion about the for ;;  statement. a bit contradicting, i think. 
> 
>> 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.
> 
> 
> Please note, not meant unfriendly. 
> 
> Kind regards
> Ted
> 
> 
> 
> 
>> On 10.03.2016, at 21:27, Erica Sadun <erica at ericasadun.com> wrote:
>> 
>>>>> On 10 Mar 2016, at 17:28, Radosław Pietruszewski <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
>> 
>> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list