[swift-evolution] When to use argument labels (a new approach)

Brent Royal-Gordon brent at architechies.com
Thu Feb 4 02:10:21 CST 2016

> I believe everything you've written here is actually expressed, in
> practice, by the guidelines I've suggested.  I went through many of the
> same thought processes in working the guidelines out.  The trick is to
> capture these thoughts in something simply stated that has the right
> effect.  If you think the guideline I suggested doesn't have the right
> effect, please demonstrate a case where your thought process would lead
> to a different API choice.

I think our positions are basically compatible; I simply find an explanation like this useful to understand *why* the rules are as they are. Many of the objections and alternative proposals I've been seeing don't seem to be informed by this philosophy.

I'm wondering if we should write up a rationale for the API guidelines as a design document that people can optionally read to help them understand the guiding philosophy behind the API guidelines.

(I also wonder if introducing the concept of an option in a more explicit way might clarify some rules; for instance, the rule about giving the first parameter a label if it's defaulted is really about giving it a label if it's an *option*.)

Brent Royal-Gordon

More information about the swift-evolution mailing list