<div dir="ltr">I'm quite sure if Chris had announced "significant whitespace" instead of "braces", the other half of the audience would have cheered :)</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 20, 2015 at 9:05 AM, Amir Michail via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On Dec 20, 2015, at 11:44 AM, Bart Whiteley via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
><br>
> On Sun, Dec 20, 2015 at 8:17 AM, Amir Michail via swift-evolution<br>
> <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br>
>> // braces are optional here but you could still put them in if you want to<br>
>> for i in 0..<10<br>
>> for j in 0..<5<br>
>> if i % 2 == 0<br>
>> print(i+j)<br>
>> print(i*j)<br>
>><br>
><br>
> -1. Please no. The fact that Swift requires curly braces even in<br>
> situations where C does not is a great feature. I still remember the<br>
> cheer that erupted from the '14 WWDC crowd when mandatory braces were<br>
> announced -- and rightfully so. Many bugs are prevented by mandatory<br>
> braces.<br>
<br>
</span>The reason they cheered is because omitting braces for one line scopes is a source of bugs. Braces should ALWAYS be required for one line scopes, even if indentation allows you to omit braces in other contexts.<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
> _______________________________________________<br>
> swift-evolution mailing list<br>
> <a href="mailto:swift-evolution@swift.org">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>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org">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>
</div></div></blockquote></div><br></div>