[swift-evolution] Analysis of case conventions for initialisms

Carlos Parada carlosparada at me.com
Fri Feb 12 12:09:31 CST 2016


I’ve used the .NET frameworks and conventions extensibly and while some of them didn’t look quite right initially, they grew up on me and now I prefer them.

They do seem to use uppercase for two letter acronyms, but not for abbreviations though. When I started doing .NET I was so used to typing ID (as in identifier), but their convention is to type Id, as in CustomerId, or idForObject. It makes sense, just as you would use Ptr for Pointer, or Int for Integer.

— Carlos Parada

> On Feb 12, 2016, at 8:22 AM, Charles Kissinger via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> 
>> On Feb 12, 2016, at 1:39 AM, Xiaodi Wu via swift-evolution <swift-evolution at swift.org> wrote:
>> 
>> Based on the examples, #2 does seem to have the most advantages. But:
>> what to do with vendor prefixes? Are those to be an exception?
>> 
>> Another tidbit: .NET seems to have its own exceptions--not sure if
>> there are rules for them, but just at the namespace level there's
>> System.IO and UIAutomationClientsideProviders, spelled as shown.
> 
> .NET has a specific exception for two-letter initialisms. They are all uppercase (or all lowercase at the start of a variable name). It’s in their guidelines, but I don’t think they say much about the rationale. I imagine they decided Io, Ui, etc. just don’t look right.
> 
> —CK
> 
>> 
>> 
>> On Fri, Feb 12, 2016 at 3:07 AM, Dave Abrahams via swift-evolution
>> <swift-evolution at swift.org> wrote:
>>> 
>>> on Fri Feb 12 2016, Rob Mayoff <swift-evolution at swift.org> wrote:
>>> 
>>>> I have been using #2 for years in many languages (including Objective-C and
>>>> more recently Swift) and much prefer it.
>>>> 
>>>> Incidentally, "ASCII" is one of the examples in the definition of "acronym"
>>>> in OS X's American English dictionary.
>>> 
>>> Yup, you're right.
>>> 
>>>> On Thu, Feb 11, 2016 at 11:51 PM, Dave Abrahams via swift-evolution <
>>>> swift-evolution at swift.org> wrote:
>>>>> 
>>>>> I just posted a write-up about various case conventions for initialisms:
>>>>> https://gist.github.com/dabrahams/55fc5ece355da4664730.  I was surprised
>>>>> at how it turned out, FWIW.
>>>>> 
>>>> _______________________________________________
>>>> swift-evolution mailing list
>>>> swift-evolution at swift.org
>>>> https://lists.swift.org/mailman/listinfo/swift-evolution
>>> 
>>> --
>>> -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
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution



More information about the swift-evolution mailing list