<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 22, 2016, at 5:07 PM, Erica Sadun 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=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Jun 22, 2016, at 8:36 AM, Adrian Zubarev 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 class="bloop_markdown" style="font-family: Helvetica, Arial; font-size: 13px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(254, 254, 254);"><p style="margin: 15px 0px; -webkit-margin-before: 0px;" class="">I’d love to see something like this happen to Xcode. I’m curious if we could write an extension for Xcode 8 to refactor code to at least some of the conventions.<span class="Apple-converted-space"> </span></p></div></div></blockquote></div><div class="">I don't believe these rules have a place in the API guidelines</div></div></div></blockquote><div><br class=""></div><div>No, not API guidelines per se, but code-style guidelines. I think for the sake of a more unified code-style, given the team's strong position on not allowing any language dialects, I'd suggest something like this being put together. (Yes, I understand that a language dialect is something different, but the point is that there is a strong feeling about a unified languaged.)</div><div><br class=""></div><div>When you look at various code in ObjC (StackOverfow, Github), the code styles vary incredibly and it's a mess, looking at some code gives you a headache because it is obvious that the person who wrote it came from C# environment. Yes, it's up to the project's team to decide on some minor things (e.g. whether to go by the 80-char per line limit, use explicit self, etc.), but the major things, such as placement of brackets, colons, spaces between them, etc. should be standardized.</div><div><br class=""></div><div>Because currently, as Ben has pointed out, the standard library has a different code-style than the Swift Programming Language or the WWDC presentation and it will diversify over the time.</div><div><br class=""></div><div>I kind of really like what Microsoft has done with C# - their coding conventions are out there, clear and precise.</div><div><br class=""></div><div><a href="https://msdn.microsoft.com/en-us/library/ff926074.aspx?f=255&MSPPError=-2147217396" class="">https://msdn.microsoft.com/en-us/library/ff926074.aspx?f=255&MSPPError=-2147217396</a></div><div><br class=""></div><div>You may ask why would one care? Aside from me being kind of a nitpicker in this area, this is nice when you share code between projects - you have a single code-style even if you share the code.</div><div><br class=""></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="">, which are meant to address how Swifty APIs should be constructed for consumption. Style rules are best addressed by in-house style guides. I've personally adopted left-magnetic colons. This follows the Docs team style. The stdlib folk appear to use floating colons for protocol conformance.</div><div class=""><br class=""></div><div class=""><div class="">As for Xcode, the new code editor extensions provide exactly this kind of functionality. </div><div class=""><br class=""></div></div><div class="">-- E</div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-evolution<br class=""></div></blockquote></div><br class=""></body></html>