[swift-evolution] [Review] SE-0023 API Design Guidelines

Dave Abrahams dabrahams at apple.com
Sun Jan 24 23:53:00 CST 2016


on Sun Jan 24 2016, Jacob Bandes-Storch <swift-evolution at swift.org> wrote:

> Er, my last sentence used the terms backwards. While I clearly can't claim
> to understand the difference anymore ;-)  I think my point is still valid.

Unfortunately, maybe because of the mix-up, it isn't clear to me what
your point was.

My point about Nasa is that even if it looks weird, the mixed case is a
strong prompt to "sound it out" rather than "spell it out," which is how
an acronym is supposed to be pronounced, and thus it leads to the right
interpretation.

> On Sun, Jan 24, 2016 at 4:26 PM, Jacob Bandes-Storch
> <jtbandes at gmail.com>
> wrote:
>
>> Nasa doesn't read fine to me; it's never stylized that way. Radar does,
>> and scuba, because they've been appropriated for use as non-capitalized
>> words over time in the language. I understand the difference, but I don't
>> think the useful distinction (for purposes of this discussion) is between
>> acronyms and initialisms. You probably can't find acronyms that are
>> stylized as sentence-/lowercase, but you can certainly find initialisms
>> that aren't (e.g. NASA).
>>
>> Jacob Bikeshed-Swift
>>
>> On Sun, Jan 24, 2016 at 3:13 PM, Dave Abrahams via swift-evolution <
>> swift-evolution at swift.org> wrote:
>>
>>>
>>> on Sun Jan 24 2016, Charles Kissinger
>>> <swift-evolution at swift.org> wrote:
>>>
>>> >> On Jan 23, 2016, at 10:39 PM, Douglas Gregor
>>> >> <dgregor at apple.com>
>>> wrote:
>>> >>
>>> >>>
>>> >>> On Jan 22, 2016, at 9:34 PM, Charles Kissinger
>>> >>> <crk at akkyra.com
>>> >
>>> >>> <mailto:crk at akkyra.com>> wrote:
>>> >>>
>>> >>>>
>>> >>>> On Jan 22, 2016, at 3:59 PM, Trent Nadeau via swift-evolution
>>> >>>> <swift-evolution at swift.org
>>> >>>> <mailto:swift-evolution at swift.org>>
>>> >>>> wrote:
>>> >>>>
>>> >>>> Under "Follow case conventions", how should acronyms (like "HTML")
>>> be handled: HTMLElement or HtmlElement?
>>> >>>
>>> >>> I would certainly prefer the second style. Unless the acronym comes
>>> >>> at the end of the identifier, it is more readable when only the
>>> >>> first letter of the acronym is uppercase, IMO. Otherwise the
>>> >>> acronym merges with the capitalized first letter of the following
>>> >>> word.
>>> >>>
>>> >>> Using all caps for acronyms also doesn’t work very well at the start
>>> of a variable name, leading to:
>>> >>>
>>> >>> var hTMLElement = HTMLElement()
>>> >>>
>>> >>> versus:
>>> >>>
>>> >>> var htmlElement = HtmlElement()
>>> >>
>>> >> Interesting. For me, it feels like the acronym should should up in
>>> >> ALLCAPS or nocaps; never with just a Leadingcap. For example:
>>> >>
>>> >>      var htmlElement = HTMLElement()
>>> >>
>>> >
>>> > I guess I just don’t like my function calls SHOUTing at me. :-)
>>> >
>>> > The leading-caps-for-acronyms style might not be particularly
>>> > popular. The most prominent use I’m aware of is in the .NET
>>> > frameworks.
>>>
>>> Peeple, please.  Not to pick nits, but these are *initialisms*, not
>>> *acronyms*
>>> (http://www.dailywritingtips.com/initialisms-and-acronyms/). The
>>> difference matters, because there's a very good argument for using
>>> different conventions for the two, i.e. Nasa and Radar (acronyms) read
>>> fine while Html and Fbi and Cia (initialisms) ... don't.
>>>
>>> --
>>> -Dave
>>>
>>> _______________________________________________
>>> swift-evolution mailing list
>>> swift-evolution at swift.org
>>> https://lists.swift.org/mailman/listinfo/swift-evolution
>>>
>>
>>
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-- 
-Dave



More information about the swift-evolution mailing list