<div dir="ltr">Yes, I went out of my way to point out that it *is* contrived, because even a programmer who uses a newline for the opening brace *elsewhere* in the same project, isn't going to take up 11 lines to define one variable.</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 20, 2015 at 7:52 AM, Dennis Lysenko <span dir="ltr"><<a href="mailto:dennis.s.lysenko@gmail.com" target="_blank">dennis.s.lysenko@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Contrived example Charles. Apple's tutorials consistently put braces on the line of the statement declaration. <a href="https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/ControlFlow.html#//apple_ref/doc/uid/TP40014097-CH9-ID120" target="_blank">https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/ControlFlow.html#//apple_ref/doc/uid/TP40014097-CH9-ID120</a><div><div class="h5"><div><br><div class="gmail_quote"><div dir="ltr">On Sun, Dec 20, 2015 at 7:16 AM Charles Constant via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Andrey's post encourages me to veer into the merits of significant whitespace vs braces. This is probably unwise of me, since we're not all going to agree any time soon, but I can't resist pointing out an example:</div><div><br></div><div>////////////////////////////////////////////////////////////////////////<br></div><div><br></div><div><div>var foo: Int </div><div>{</div><div> get </div><div> { </div><div> return _foo</div><div> }</div><div> set </div><div> {</div><div> _foo = newValue</div><div> }</div><div>}</div><div><br></div></div><div><div><div>////////////////////////////////////////////////////////////////////////<br></div></div></div><div><br></div><div><div>var foo: Int:</div><div> get: </div><div> return _foo</div><div> set:<br></div><div> _foo = newValue</div><div><br></div></div><div><div>////////////////////////////////////////////////////////////////////////<br></div></div><div><br></div><div>It's obvious no programmer is going to be consistent about braces in the first example - it's absurdly verbose. So with braces in Swift, pretty much everything you write carries the overhead of "what inconsistent way will i format the braces for this code?" For me, I'd rather throw out the (largely redundant) noise, and stick with just the content.</div><div><br></div><div><br></div><div> </div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"></div></div><div class="gmail_extra"><div class="gmail_quote">On Sun, Dec 20, 2015 at 3:59 AM, Andrey Tarantsov via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><span><blockquote type="cite"><div><div dir="ltr"><div>I don't know many people who have experienced a large variety (8+?) of programming languages and prefer Python's forced indentation</div></div></div></blockquote><div><br></div></span><div>Count me as one. I'd prefer Swift to have Python-style indentation, just on the grounds of braces being stupid (why would you want to enter the same scope information <i>twice</i>)?</div><div><br></div><div>So +1 from me, although I don't suffer from the braces at all.</div><div><br></div><div>I do want to point out that the amount of code that fits on a screen <b>is</b><i> </i>fairly important, and you should keep your methods short, so one less brace per method means a couple more methods per screen.</div><div><br></div><div>This would also free up braces to mean “closure” in 100% of cases, which is good for consistency.</div><div><br></div><div>But it would introduce it's share of problems for sure, so I don't feel strongly about this proposal.</div><div><br></div><div>I also admit that braces are generally preferred, for some mysterious reason that I hope a believer can articulate here. Take Sass, for example; it has both an indentation-based syntax and a braces-based syntax, and the latter one seems way more popular.</div><div><br></div><div>A.</div><div><br></div></div>
</div></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><img src="https://u2002410.ct.sendgrid.net/wf/open?upn=l3fs1g-2F466j3y5fD5Q61KddsTTCmXL0uxw3XoAMFFNjs1zLdXswAEplDZrmAtIc0LqzCipvOLyzgkbwiVVjPWAdARS5Nq9xO-2FuLvouA90AbYrN5ZDG2be7eORfL9ScUgPSW5c3ynPZAMgKyql9niOLwkBMEyIhl-2B4Xn6C0QoY6v-2FgQ1t4hKfKjA19n9FBktkRj5M6fzABGCxjAvSake1mJe1ziPkbzqcUKwMOL2bwSE-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0px!important;margin:0px!important;padding:0px!important;display:none!important">
</div></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
<br></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div><br></div>
<img src="https://u2002410.ct.sendgrid.net/wf/open?upn=8CZIdLciSFC-2BO5jF-2FiP8qN7dBFsgCUZ50wdTsolcRPfPjhhwehHJew6uTsbXuReOv0B5E5dyHXBwowgKaf109pOdzENp4Pz81iXM-2BmOYWG2itGRa2DPL0uY78P7OeFUTmLkLG8GkQy2cWKiBBz8hOfeczYuFL84hw8vkUZ-2BtC-2B8JO-2FYaZpX2YpkcPIi8R6jQUrRpThAdg8SdxDBokbQ41rIgEASylC-2BPA9ez-2FTE784s-3D" alt="" width="1" height="1" border="0" style="min-height:1px!important;width:1px!important;border-width:0px!important;margin:0px!important;padding:0px!important;display:none!important">
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div></div></div></div></div>
</blockquote></div><br></div>