<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 24, 2016, at 9:33 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" class="">xiaodi.wu@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 10px; 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;" class="">On Fri, Jun 24, 2016 at 2:26 PM, Charlie Monroe<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:charlie@charliemonroe.net" target="_blank" class="">charlie@charliemonroe.net</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><br class=""><div class=""><span class=""><blockquote type="cite" class=""><div class="">On Jun 24, 2016, at 9:00 PM, Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> wrote:</div><br class=""><div class=""><div dir="ltr" class="">On Fri, Jun 24, 2016 at 1:56 PM, Sean Heber<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:sean@fifthace.com" target="_blank" class="">sean@fifthace.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><span class="">> On Jun 24, 2016, at 1:30 PM, Xiaodi Wu via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> wrote:<br class="">><br class="">> On Fri, Jun 24, 2016 at 6:37 AM, William Shipley <<a href="mailto:wjs@mac.com" target="_blank" class="">wjs@mac.com</a>> wrote:<br class="">> On Jun 23, 2016, at 11:04 PM, Xiaodi Wu <<a href="mailto:xiaodi.wu@gmail.com" target="_blank" class="">xiaodi.wu@gmail.com</a>> wrote:<br class="">>><br class="">>> Not a practitioner of 80-character line limits, I take it?<br class="">><br class="">> I don’t understand why anyone wouldn’t just let Xcode do the wrapping for most cases. I’ll add newlines if I think it adds to clarity, but in general I don’t want to code like i’m still on a Wyse WY-50.<br class="">><br class="">> Of course, to each their own style--I certainly wouldn't want Swift to force everyone to write lines of certain lengths. But 80-character lines is a common style, and I would say that a corollary of "to each their own" is that Swift's grammar should be usable and useful whether or not you adhere to such style choices.<br class=""><br class=""></span>I honestly don’t believe that this a common style in the Cocoa community.</blockquote><div class=""><br class=""></div><div class="">We're talking about the Swift community here, and Swift stdlib would be a good starting point as to what is a common or at least accepted style; it uses 80-character lines.</div></div></div></div></div></blockquote><div class=""><br class=""></div></span><div class="">While it does, it makes sense only for readability purposes of the documentation. For example, I see absolute no reason why to split <a href="https://github.com/apple/swift/blob/master/stdlib/public/core/StringBuffer.swift#L233" target="_blank" class="">https://github.com/apple/swift/blob/master/stdlib/public/core/StringBuffer.swift#L233</a> into two lines.</div><div class=""><br class=""></div><div class="">It makes the code less readable.</div><div class=""><br class=""></div><div class="">80-char style made sense in C, where everything is pretty much top-level. But given that you declare a class, within which you declare another class, within which you declare methods, the first level of the method indentation is at level 3, which given 4 spaces per tab gives you 12 characters already. Adding a few levels (for-cycle + an if statement within the for cycle) gives you 20 characters of just whitespace (1/4 of the allocated 80 chars per line).</div><div class=""><br class=""></div><div class="">Which is why I don't believe this code style is valid in a modern language.</div></div></div></blockquote><div class=""><br class=""></div><div class="">This is one style that some very intelligent people use in Swift. I'm not going to debate what styles are "valid."</div></div></div></div></div></blockquote><div><br class=""></div><div>I'm sorry, if this sounded offensive in any way, I certainly did not mean it that way, I simply wanted to point out why I believe the 80-char limit is a bit limiting nowadays given that you can nest various constructs.</div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 10px; 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;" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div style="word-wrap: break-word;" class=""><div class=""><div class="">My personal guess is that it should be upped to e.g. 160 chars per line - that kind of makes sense. There is no particular reason other than historic why we're still using 80 chars per line.</div><br class=""><blockquote type="cite" class=""><div class=""><span class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;">I’m not a member of the “old guard” having only come into this world 10 years ago with the iPhone, but just take a look at this delegate method in Objective-C:<br class=""><br class="">- (void)locationManager:(CLLocationManager *)manager rangingBeaconsDidFailForRegion:(CLBeaconRegion *)region withError:(NSError *)error;<br class=""><br class="">That’s well over 80 characters all by itself. This fits on my screen in a single line - and I work on a 15” MBP with room for my dock always visible on the side along with Xcode’s sidebar open! On a typical desktop-sized screen, 80-col lines must be comically short.<br class=""><br class="">I don’t know why it should be assumed that people are adhering to a so-called standard that dates back to terminal screens that didn’t have color.<br class=""><span class=""><br class=""><br class="">> If the chief advantage of `where` is that it (quoting someone above) allows one to "understand as much as possible about the control flow of the loop from a single line of code," then we ought perhaps to question its appropriateness when the majority of its benefits [by which I mean, based on your examples and Sean's, more than half of the instances in which it is used] cannot be realized in a very common coding style.<br class=""><br class=""></span>Again, I dispute the idea (having no data but my own :P) that 80-col limits are common in this community.<br class=""><br class="">l8r<br class=""><span class=""><font color="#888888" class="">Sean<br class=""><br class=""></font></span></blockquote></div><br class=""></div></div></span><span class="">_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a></span></div></blockquote></div></div></blockquote></div></div></div></div></blockquote></div><br class=""></body></html>