[swift-evolution] When to use argument labels, part DEUX

Dave Abrahams dabrahams at apple.com
Fri Feb 5 20:03:52 CST 2016


on Fri Feb 05 2016, David Hart <swift-evolution at swift.org> wrote:

>> 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.

Can you explain in what way it is less readable?  Do you mean "it just
sticks in my craw," or do you mean "I don't know how to intepret it,"
or, "it means the wrong thing," or...?

Again, I can understand your preference for it, but to justify making a
special rule for it I need some kind of objective reasoning.

-- 
-Dave



More information about the swift-evolution mailing list