[swift-evolution] SE-0059: Update API Naming - leading dot prefix for enum instances.

John Heerema jheerema at ucalgary.ca
Fri Apr 1 15:25:33 CDT 2016

If I may, I would like to express support for NOT making this change.

One of Swift's really nice features is its ability to remove unnecessary syntactic cruft in cases where the context makes it possible for the compiler to infer a type or name. It's one of Swift's best features, and I would hate to see it chipped away.

I feel that Swift's existing syntax is superior to the proposal to require a leading dot prefix for enum instances. The simple reasons are readability, flexibility, and brevity. Swift is already smart enough to let developers skip the tedious qualification of enums in many cases.

If someone feels that a leading dot for enum cases  inside enum implementations makes their code clearer, there is nothing stopping them from doing so, and encouraging others to follow their lead. If the vast majority of developers voluntarily started doing so, I might even support this proposal. I don't think they will though.

Making a dot prefix mandatory here I feel, chips away at one of Swift's rather nice features, without a clear benefit.

In general, making things mandatory, rather than a matter of  stylistic choice, is unlikely to endear the language to developers - and I'd really like to see Swift succeed in a big way.

Dr. J. Heerema

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160401/d219201b/attachment.html>

More information about the swift-evolution mailing list