[swift-evolution] [Review] SE-0023 API Design Guidelines
Dave Abrahams
dabrahams at apple.com
Sat Jan 23 13:34:55 CST 2016
on Sat Jan 23 2016, Marc Knaup <swift-evolution at swift.org> wrote:
>> Proposal link: https://github.com/apple/swift-evolution/blob/master/proposals/0023-api-guidelines.md
>
> What is the rationale behind naming enumeration cases in upper camel case?
>
> *Follow case conventions:* names of types, protocols and enum cases are
>> UpperCamelCase. Everything else is lowerCamelCase.
>
> let a = NSComparisonResult.OrderedSame // refers to a value, but is upper-case
> let b = NSDate.distantFuture // refers to a property/value, but is lower-case
>
> - everything related to types (type names, protocol names, generic type
> parameter names) should be upper camel case
> - everything else (function names, property names, variable names, etc.)
> should be lower camel case
>
> This is already the current and the proposed recommendation with
> enumeration cases being the only exception.
> Enumeration cases are not types.
FWIW, I don't think that we have a defensible rationale, and feel
strongly that we should change this. Of course, it's not up to me
alone...
--
-Dave
More information about the swift-evolution
mailing list