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

John Siracusa siracusa at gmail.com
Fri May 13 16:07:44 CDT 2016


Having used, more or less continuously for my 20 years as a professional
programmer, both a language that allows trailing commas and one that does
not, I come down pretty strongly on the side of allowing trailing commas
(for all the reasons already stated in this thread). If it means requiring
a newline after the last comma to make some people feel better about it, so
be it.

-John



On Fri, May 13, 2016 at 1:46 PM, Erica Sadun via swift-evolution <
swift-evolution at swift.org> wrote:

>
> On May 13, 2016, at 11:29 AM, Joe Groff <jgroff at apple.com> wrote:
>
>
> On May 13, 2016, at 7:04 AM, Erica Sadun <erica at ericasadun.com> wrote:
>
> On May 12, 2016, at 11:01 PM, Chris Lattner via swift-evolution <
> swift-evolution at swift.org> wrote:
>
> On May 12, 2016, at 4:50 PM, Joe Groff <jgroff at apple.com> wrote:
>
> You’re arguing that you want to read Swift code written like this?
>
>
> I wouldn't mind it.
>
>
> I personally find that style repulsive :-) and I haven’t seen swift code
> commonly doing it.  I’m not sure that we want to encourage it either.
>
>
> No. Tell us what you *really* think of the style. Don't hold back.[1]
>
> If we were really concerned about this, a narrower way to solve the same
> problem would be to allow a comma before the ), but *only* when there is a
> newline between them.  I still don’t see why we’d want to encourage this
> though.
>
>
> I wouldn't object to this restriction. I cannot think of a situation where
> using ",)" -- that is the comma adjacent to a closing parenthesis -- makes
> sense for any reason previously enumerated in support of this proposal.
>
>
> I don't see why we need to micromanage the situations where trailing
> commas are allowed. That's just unnecessarily increasing the fractal
> complexity of the language. We've delegated other style choices like
> requiring `self.` or brace formatting to linters; why does this one need to
> be legislated by the compiler?
>
> -Joe
>
>
> Mostly because I'm trying to play nice and get Chris to reconsider. I'd
> like to get the feature, I'm willing to compromise on the technicalities.
> Having it would make my coding life significantly easier and if a little
> micromanagement is involved, I'm not terribly fussed. When I need trailing
> commas, it's always at the ends of lines anyway.
>
> But since I don't want to undercut you, so I'd much prefer to step back
> and defer to your judgement on this.
>
> -- E
>
>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160513/ef8148fe/attachment.html>


More information about the swift-evolution mailing list