[swift-evolution] Issues with 0005-Better Translation of Objective-C APIs Into Swift
Gwendal Roué
gwendal.roue at gmail.com
Wed Feb 3 13:08:47 CST 2016
> Le 3 févr. 2016 à 19:46, Dave Abrahams <dabrahams at apple.com> a écrit :
>
>
> on Wed Feb 03 2016, Gwendal Roué <gwendal.roue-AT-gmail.com> wrote:
>
>>>>> You wouldn't say "go to the garden and trim the plant: rhododendrons".
>>>>> It isn't necessary for comprehension. Why do you feel characters: is
>>>>> necessary here?
>>>>
>>>> Precisely because of what you stated a few lines above : "I don't
>>
>>>> think *anybody* on this list believes [API] should [be relying on well
>>>> named inputs »:
>>>>
>>>> let s: NSCharacterSet = .whitespaceAndNewlines
>>>> let content = listItemView.text.trimming(s) // what?
>>>
>>> That's not relying on well named inputs; it's relying on context, and
>>> *that* is perfectly alright. We are never going to get to the point
>>> that you can do without context in reading code. Proof: there's no
>>> label for the receiver, yet you're not complaining. is
>>>
>>> v.text.trimming(characters: s)
>>>
>>> somehow perfectly clear when
>>>
>>> listItemView.text.trimming(s)
>>>
>>> is not?
>>
>> Well, Dave, despite all your efforts to make points, one version
>> requires more context than the other, and is thus less clear.
>> You are in the brevity team, that’s pretty clear.
>
> No, really, I'm in the clarity team.
Well, I won’t be very wrong if I say that Cocoa APis have often been praised for their clarity, despite the fact that they are all but terse :-)
Gwendal
More information about the swift-evolution
mailing list