[swift-evolution] When to use argument labels, part DEUX
David Hart
david at hartbit.com
Fri Feb 5 19:13:14 CST 2016
> Again, I understand the aesthetic preference for this form; I even
> prefer it myself. On the other hand, it seems to me that the difference
> between the two forms reflects a point of emphasis that isn't crucial to
> understandability at the use-site. That's why I'm asking whether you
> *can't live with* the results. Are you merely expressing a strong
> preference, or are you saying the first form is too awful to abide?
>
>> But I’m not sure how to write a simple rule to explain this reasoning.
>
> Any *additional* rule is more complexity in the guidelines, which would
> have to pay for itself in some objective terms. Since (I'm assuming
> you'll agree that) it doesn't make a difference to understandability,
> what objective criteria would you use to justify accomodating cases like
> this?
I’m not an extreme enough person to say that it’s too awful to abide :), but I definitely lie more on that side of the fence than the simple strong preference.
To come back to your other examples, even if I prefer the forms you described in your new thread:
a.dismiss(animated: b)
a.tracksWith(mediaType: b, composer: c)
The alternatives:
a.dismissAnimated(b)
a.tracksWithMediaType(b, composer: c)
Shock me much much less than:
a.moveFrom(b, to: c)
That last one is many times less readable to me.
David.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160206/b07b81df/attachment.html>
More information about the swift-evolution
mailing list