<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><div id="AppleMailSignature">-1.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">Please don't change the guideline. It's good as it is.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">First, there's an important precedent for UpperCamelCase enums in other languages that Swift has some kinship with, e.g. C#, Rust, and Scala. People coming to Swift from these languages immediately feel at home with the current guideline.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">Second, there's an even bigger precedent for treating enums differently from other identifiers. In languages where UpperCamelCase isn't the rule, e.g. C, C++, and Java, the practice is often to name enums using UPPERCASE. This says something about how people see enums: as something that should stand out. Making them lowerCamelCase goes against this.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">Finally, using UpperCamelCase makes enums much more readable when used with Swifts's ability to infer the enum type. It's immediately clear that this is an enum:</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">suit = .Hearts</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">But it's not so clear what this is:</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">suit = .hearts</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">What is hearts? Is it a property? Where does it come from? This makes the language harder to learn and harder to read.</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">Consistency should be a goal when it aids clarity and readability. In this case, it would make code less clear and less readable, and it would go against established practice.</div><br>/Jonathan</div><div><br>22 dec. 2015 kl. 03:38 skrev Dave Abrahams via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>>:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 21, 2015, at 3:58 PM, Michael Wells via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">I love that Swift has a published API design guidelines at <a href="https://swift.org/documentation/api-design-guidelines.html" class="">https://swift.org/documentation/api-design-guidelines.html</a>, but one thing about it bugs me: the use of <b class="">UpperCamelCase</b> for cases. I know this ship has long sailed, </div></div></div></blockquote><div><br class=""></div>It has not sailed at all. This is totally open for discussion.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">but why didn't the team choose <b class="">lowerCamelCase</b> for these? The current style seems inconsistent and requires an “instances are lowerCamelCase, aside from Enums” clarification.</div><div class=""><br class=""></div><div class="">-mw<br class=""><div class=""><div class=""><br class=""></div></div></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=JfMPa-2F7wwZPzsZ3QKA8NjtONIYX4SjbWuUxtpfsTY2hc8W07O6vQenOBZqJatSu06SrVKeuA2GotkqUbpym8lN5kJMBiAYdrFbEUeupXwjhAiBj5U8-2BHHdhn-2FEnu4oTXrvoRgu-2BM0cCRINczjJlhDbZpdM7lZ-2FpzMBE-2FYCGGk3mBSGy16ZU94KeFr1qhN4BRqnLRZYA9tvTQqc0B1JjLXTLOHNYWeGuo8NgYpHqYZyI-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;" class="">
</div>
_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""><div class="">
-Dave<div class=""><br class=""></div><br class="Apple-interchange-newline">
</div>
<br class="">
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=3H-2Bjq6g-2FrmhPdZznzzcOM7hJzszzEydjVMmbmBFWR97Wb3euGM1HQiw0DM1e3pfu-2B9gw-2FxvaSeVNIlTqqXyggAzP81f9YjArb6R01za-2Bwcy-2BGniqAnBc4jf3bbFrrthrKGuYfowyvnMNE0M-2BXTEavTcYkhnmQEgZKWIcz11od1QwDUpJBPgAG8oBtdqMAFoBXft1SPV4KwlCp68eM5D-2FDt5MHrNcwo4n1flI-2FwJY0Bw-3D" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;">
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>swift-evolution mailing list</span><br><span><a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a></span><br><span><a href="https://lists.swift.org/mailman/listinfo/swift-evolution">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span><br></div></blockquote></body></html>