[swift-evolution] SE-0005 ==> Please keep well know acronyms capitalized!

Tony Allevato allevato at google.com
Thu May 19 12:21:39 CDT 2016


I strongly prefer that things like properties and variables, even if they
start with an acronym or initialism, start lowercase. When writing
Objective-C, if I have a property or variable named just "url", I always
debate whether I should call it "URL" or "url".

This will become even trickier once Foundation classes drop the NS* prefix,
so we'll have a type named URL. In that case, what would you call a
variable of the same time? Either "url", or you come up with a more
contrived name where maybe "url" would have been sufficient.

That's not the only example, but one of my projects is in the business of
generating Swift code, and being able to predictably generate UpperCamel
for types and lowerCamel for properties goes a long way toward avoiding
collisions.


On Thu, May 19, 2016 at 10:15 AM Brandon Knope via swift-evolution <
swift-evolution at swift.org> wrote:

> Do you have a particular reason? I don't think because it is a certain way
> in Objective-C means it must be that same way in Swift.
>
> Brandon
>
> Sent from my iPad
>
> > On May 19, 2016, at 1:04 PM, Pavel Kapinos via swift-evolution <
> swift-evolution at swift.org> wrote:
> >
> > Hi,
> >
> > SE-0005 "Better Translation of Objective-C APIs Into Swift Proposal” in
> Proposed Solution # 6 "Lowercase values" suggests “to lowercase
> non-prefixed values whenever they are imported” with an example of
> URLHandler property becoming urlHandler. Being long time Cocoa developer, I
> object to this particular example and would like to suggest to keep
> capitalized any well known acronyms, like ASCII, PDF, URL etc. as they are
> now in Cocoa. Thank you!
> >
> > Cheers,
> > Pavel.
> > _______________________________________________
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160519/ebb0e752/attachment.html>


More information about the swift-evolution mailing list