[swift-evolution] Analysis of case conventions for initialisms

Marco Masser lists at duckcode.com
Mon Feb 15 04:01:07 CST 2016


> On 2016-02-12, at 17:35, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
> 
> on Fri Feb 12 2016, Marco Masser <swift-evolution at swift.org> wrote:
> 
>> Strong dislike for #2. I understand and accept the benefits, but I
>> just don’t like how that looks.
>> 
>> I also don’t use #1 or #3. Instead, initialisms in my code are always
>> all uppercase, no exceptions.
>> 
>> For type names, I can’t remember a case in my code where that could
>> not be avoided or was too bad to read.
>> For local variables, methods, and functions, I try to find a name that
>> puts the initialism at the end of the name, e.g. let publicationURL =
>> document.URLForPublication
> 
> Interesting approach.  If you'd like to create an amended document that
> accounts for that one, too, I'd be happy to incorporate it.  However,
> note that I've tried pretty hard to stay away from subjective factors in
> the analysis; it would be good if you could do the same.  

I added this as Convention #4, along with a new paragraph at the end of the analysis:
https://gist.github.com/marcomasser/2828cf68fb26255fb295

I think I kept it objective and I hope my additions match your expectations for this document. I took the liberty to change some names in the sample code to match what I’m proposing, e.g. “urlForPublication” became “publicationURL”.

Please let me know if I should change anything.


> A separate poll on the violence of peoples' negative reaction to each
> choice might not be a bad idea—that stuff counts, too, as long as more
> than a handful of people respond.

Agreed. Although I just want to state that mine is just a strong dislike for #2 and there is no actual violence involved in my reaction 😀


> 
>> In my experience, my guidelines don’t always work. Just like everyone else’s.
>> 
>>> On 2016-02-12, at 06:51, 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.
>>> 
>>> Cheers,
>>> 
>>> -- 
>>> -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
> 
> _______________________________________________
> 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