[swift-evolution] API Guidelines Update

Dave Abrahams dabrahams at apple.com
Wed Feb 24 16:55:26 CST 2016


on Wed Feb 24 2016, Jordan Rose <swift-evolution at swift.org> wrote:

>> On Feb 24, 2016, at 11:25, Dave Abrahams via swift-evolution
>> <swift-evolution at swift.org> wrote:
>> 
>> 
>> on Wed Feb 24 2016, David Owens II
>
>> <swift-evolution at swift.org
>> <mailto:swift-evolution at swift.org>>
>> wrote:
>> 
>>>> On Feb 22, 2016, at 11:02 AM, Jordan Rose via swift-evolution
>>>> <swift-evolution at swift.org> wrote:
>>>> 
>>>> In case it's been lost in all the discussion, the -ing/-ed rule is
>>>> essentially the rule Objective-C uses, minus the noun labels for the
>>>> return value and types and the word "by". It's definitely very
>>>> different grammatically from most other API guidelines, but so are
>>>> Objective-C's guidelines.
>>>> 
>>> 
>>> Sure, but I'd actually argue that the noun-labels in ObjC are what
>>> actually provide the context of the non-mutating nature of the
>>> function. 
>> 
>> I disagree with that assertion.  The nouns tell you what type is going
>> to be returned and what type is being passed, not whether there will be
>> mutation to the receiver.
>
> For the Cocoa value types, I agree with DavidO that a return-type noun
> reliably distinguishes mutation from non-mutation, 

I would agree with that too, but IIUC he's not claiming something about
how it works statistically in Cocoa.  Instead, I understand him to be
saying that it's somehow intrinsically more obvious to an English
speaker.

> and is a better-than-50% indicator for methods on other types as well.

Types other than what?

-- 
-Dave



More information about the swift-evolution mailing list