[swift-evolution] [Pitch] Enforce argument order for defaulted parameters

Erica Sadun erica at ericasadun.com
Wed Mar 30 12:05:50 CDT 2016

> On Mar 30, 2016, at 10:59 AM, Joe Groff via swift-evolution <swift-evolution at swift.org> wrote:
> Many people are surprised when they find out defaulted parameters can be reordered, unlike required arguments. This special case adds complexity to the language, and runs against our general trend of treating argument labels as a significant part of an API's name, and preferring a single way of writing API calls. I think it's worth revisiting this design choice—is the special case worth the complexity? How many people take advantage of default argument reordering?
> -Joe

While I do take advantage of this feature, it would be less than honest to point out that a large portion of such
usage is to point out how cool the ability is.

That said, what I'm really doing is treating them in code like an ad hoc set of enumerated cases with associated
values. Perhaps rethinking about them in that light would be better than simply removing them from the

-- E

More information about the swift-evolution mailing list