<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On May 11, 2016, at 8:01 AM, Ricardo Parada via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; wrote:</div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class="">On May 10, 2016, at 2:53 PM, Chris Lattner &lt;<a href="mailto:clattner@apple.com" class="">clattner@apple.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hello Swift community,<br class=""><br class="">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:<br class=""><br class=""><span class="Apple-tab-span" style="white-space:pre">        </span><a href="https://github.com/apple/swift-evolution/blob/master/proposals/0084-trailing-commas.md" class="">https://github.com/apple/swift-evolution/blob/master/proposals/0084-trailing-commas.md</a><br class=""></div></div></blockquote><br class=""><blockquote type="cite" class=""><div class=""><div class=""><span class="Apple-tab-span" style="white-space: pre;">        </span>* What is your evaluation of the proposal?<br class=""></div></div></blockquote><div class=""><br class=""></div>-1</div><div class=""><br class=""></div><div class="">I don’t like the proposal. &nbsp;I understand the flexibility it gives to rearranging elements but to someone reading the code it looks like an element was removed by mistake.</div></div></div></blockquote></div><br class=""><div class=""><br class=""></div><div class="">This objection is coming up quite often and I don't really see the difference between trailing commas in collections (legal in Swift)</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal; font-family: Menlo; font-size: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">let</span><span style="font-variant-ligatures: no-common-ligatures" class=""> listenerKeys: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">NSDictionary</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = [</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170); font-size: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">AVFormatIDKey</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">: </span><span style="font-variant-ligatures: no-common-ligatures" class="">NSNumber</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(unsignedInt: </span><span style="font-variant-ligatures: no-common-ligatures" class="">kAudioFormatAppleLossless</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">),</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170); font-size: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">AVSampleRateKey</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">: </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">44100.0</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">,</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170); font-size: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">AVNumberOfChannelsKey</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">: </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">,</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(112, 61, 170); font-size: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures" class="">AVEncoderAudioQualityKey</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">: </span><span style="font-variant-ligatures: no-common-ligatures" class="">NSNumber</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(int: </span><span style="font-variant-ligatures: no-common-ligatures" class="">Int32</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span><span style="font-variant-ligatures: no-common-ligatures" class="">AVAudioQuality</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">.</span><span style="font-variant-ligatures: no-common-ligatures; color: #3d1d81" class="">Max</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">.</span><span style="font-variant-ligatures: no-common-ligatures" class="">rawValue</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">)),</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; font-size: 13px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">]</span></div></div><div class=""><br class=""></div><div class="">And trailing commas in parameter lists (not yet allowed in Swift):</div><div class=""><br class=""></div><div class=""><div style="margin: 0px; line-height: normal; font-family: Menlo; color: rgb(187, 44, 162); font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">public</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">convenience</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class=""> </span><span style="font-variant-ligatures: no-common-ligatures" class="">init</span><span style="font-variant-ligatures: no-common-ligatures; color: #000000" class="">(</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> w: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">CGFloat</span><span style="font-variant-ligatures: no-common-ligatures" class="">,</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; </span><span style="font-variant-ligatures: no-common-ligatures; color: #bb2ca2" class="">_</span><span style="font-variant-ligatures: no-common-ligatures" class=""> h: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">CGFloat</span><span style="font-variant-ligatures: no-common-ligatures" class="">,</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; position: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">CGPoint</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = .zero,</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; backgroundColor: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">UIColor</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = UIColor.whiteColor(),</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; translucency alpha: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">CGFloat</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">1.0</span><span style="font-variant-ligatures: no-common-ligatures" class="">,</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; borderWidth: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">CGFloat</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0.0</span><span style="font-variant-ligatures: no-common-ligatures" class="">,</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;borderColor: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">UIColor</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = UIColor.blackColor(),</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp;&nbsp; &nbsp;cornerRadius: </span><span style="font-variant-ligatures: no-common-ligatures; color: #703daa" class="">CGFloat</span><span style="font-variant-ligatures: no-common-ligatures" class=""> = </span><span style="font-variant-ligatures: no-common-ligatures; color: #272ad8" class="">0.0, // this is currently illegal</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; ){</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; font-size: 12px;" class=""><span style="font-variant-ligatures: no-common-ligatures" class="">&nbsp; &nbsp; ...</span></div><div style="margin: 0px; line-height: normal; font-family: Menlo; font-size: 12px;" class="">}</div></div><div class=""><br class=""></div><div class="">Neither example reads to me as if an element was removed by mistake. Both greatly enhance programming flexibility. Both allow the final comma to be omitted and/or the elements to be re-ordered.</div><div class=""><br class=""></div><div class="">To summarize the complaints to date:</div><div class=""><br class=""></div><div class="">* It make code read like errors</div><div class="">* Arrays and dictionaries are different "things" than parameters and tuples; They are structurally different</div><div class="">* Parameter lists should always be of fixed size at deployment time; Once a signature is fixed and consumed, it's difficult to change</div><div class=""><br class=""></div><div class="">To which I reply:</div><div class=""><br class=""></div><div class="">* Well structured code needn't read like an error. The examples above show an in-house style that allows final commas. Your in-house style may differ and a linter can catch these issues.</div><div class="">* Both collections and signatures are syntactically similar in layout even if they are semantically different in use. In Swift, complex method signatures with defaulted arguments like the example shown are not uncommon. Do not limit your thinking to single line lists of (x: T, y: U, z: V) signatures.</div><div class="">* Parameter lists and function signatures, like collections, can evolve, especially when using defaulted parameters, even when they are consumed at multiple points.</div><div class=""><br class=""></div><div class="">-- E</div></body></html>