[swift-evolution] [Review] SE-0046 Establish consistent label behavior across all parameters including first labels

Brent Royal-Gordon brent at architechies.com
Sun Mar 13 16:35:57 CDT 2016


> 	https://github.com/apple/swift-evolution/blob/master/proposals/0046-first-label.md

> 	• What is your evaluation of the proposal?

I think it's a great idea. In previous versions of Swift, the inconsistent treatment of function parameters was justified—barely—by the fact that standard Swift style left most arguments unlabeled. Now that the API guidelines now call for many functions to label their first parameters, this justification has been fatally weakened.

Now that we're going to have consistent rules everywhere else, I think the design team should also consider applying the same rules to subscripts. Unlike functions, subscripts still *do* usually have unlabeled first parameters, but they are written so rarely that I'm not sure it's worth being inconsistent with literally every other parameter construct in the language.

(Alternatively, making all subscript parameters unlabeled would be a simpler rule than the current one, and would suit multi-dimensional subscripts pretty nicely.)

> 	• Is the problem being addressed significant enough to warrant a change to Swift?

Yes. This has always been an ugly, complicated corner of the language, and previous efforts to simplify it have been rewarded.

> 	• Does this proposal fit well with the feel and direction of Swift?

Yes. It reflects the new API guidelines while making things simpler and consistent.

> 	• If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?

Most languages I've used have pretty simple (though often somewhat impoverished) parameter naming rules; Swift has always been oddly complicated in this way.

> 	• How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

A quick reading and a little bit of participation in the discussion thread.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list