[swift-evolution] [Review] SE-0084: Allow trailing commas in parameter lists and tuples
Thorsten Seitz
tseitz42 at icloud.com
Thu May 12 13:03:17 CDT 2016
> The review of "SE-0084: Allow trailing commas in parameter lists and tuples" begins now and runs through May 16. The proposal is available here:
>
> https://github.com/apple/swift-evolution/blob/master/proposals/0084-trailing-commas.md
>
> * What is your evaluation of the proposal?
-0.5
Trailing commas look like a mistake. While having to clean them up when editing parameter lists is unfortunate I prefer it to the untidy and erroneous look of trailing commas in the code. Remember that code is more often read than written, so the preference should be on readability.
I am not convinced by the diff argument either.
I am reluctantly ok with the existing ability to place trailing commas in arrays or dictionaries because these are conceptually more open than parameter lists or tuples or generic argument lists etc.
I’d prefer the alternative proposal of being able to omit commas when placing expressions on different lines (just like with semicolons), although I haven’t thought about possible parsing problems which might arise because of that.
But as long as I am not required to use trailing commas, I’m not strongly against this. There are more important changes to be made. I just think it is a bad idea :-)
> * Is the problem being addressed significant enough to warrant a change to Swift?
No, the task of cleaning up parameter lists is small compared to the untidy and erroneous look of trailing commas. In addition cleaning up is only necessary at the end of lists.
> * Does this proposal fit well with the feel and direction of Swift?
No. An important feature of Swift is readability which is disturbed by trailing commas.
> * If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
I haven’t.
> * How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
Followed the discussion and weighed the convenience of trailing commas against the impact on readability.
-Thorsten
More information about the swift-evolution
mailing list