[swift-evolution] [Review] SE-0084: Allow trailing commas in parameter lists and tuples

Vladimir.S svabox at gmail.com
Thu May 12 05:15:12 CDT 2016


On 11.05.2016 22:58, Joe Groff wrote:
>> On May 11, 2016, at 10:14 AM, Vladimir.S <svabox at gmail.com> wrote:
>> In this case (if this is a such good feature) IMO we should think
>> about making the trailing commas *required*. In this way we will be
>> consistent in either do we have trailing commas in Swift or don't.
>> Otherwise we'll have a zoo in our sources/projects.
>> I don't think we need to have the same rules for commas "everywhere we
>> have comma-delimited syntax".
> We've generally shied away from legislating style; see our rationale
> behind not requiring `self.` for an example:
> https://lists.swift.org/pipermail/swift-evolution/Week-of-Mon-20160104/005478.html

Got it. I expect you(the core team) will not be against new line as item 
separator in list(in addition to comma) just for the same reason. Also just 
for the same reason IMO you should not be against type inference for 
default parameters in funcs. etc
I find this rationale very 'wide' so we can end up with JavaScript(in worst 
meaning) instead of Swift at the end.

>  In languages where trailing commas are pervasively allowed, such as
> Perl, Python, Ruby, and modern Javascript, I haven't seen any indication
> that this is a major problem. Less blood has definitely been shed over
> it than over bracing style and other style wars.

For me this does not rationale why we need to introduce this 'feature' in 
Swift. There is a lot of 'cool'(or ugly, from someone's point of view) 
'features' in these languages.
And we *have* trailing comma for arrays/dicts - IMO this is a golden middle 
between both words.

> -Joe.

More information about the swift-evolution mailing list