SE-0059: Update API Naming - leading dot prefix for enum instances.

(John Heerema) #1

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