<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="">I would not like to see braces made optional. First, I think this reduces the readability of the code. While readability might be somewhat subjective, compare these two blocks of code:<div class=""><br class=""></div><div class=""><font face="Consolas" class="">// With braces // Without braces</font></div><div class=""><font face="Consolas" class="">for i in 0..<10 { for i in 0..<10</font></div><div class=""><font face="Consolas" class=""> for j in 0..<5 { for j in 0..<5</font></div><div class=""><font face="Consolas" class=""> if i %2 == 0 { if i %2 == 0</font></div><div class=""><font face="Consolas" class=""> print(i+j) print(i+j)</font></div><div class=""><font face="Consolas" class=""> } print(i*j)</font></div><div class=""><font face="Consolas" class=""> print(i*j)</font></div><div class=""><font face="Consolas" class=""> }</font></div><div class=""><font face="Consolas" class="">}</font></div><div class=""><font face="Consolas" class=""><br class=""></font></div><div class="">IMHO, it is easier to see that "print(i*j) is part of the block belonging to the inner for loop, rather than the if statement, when braces are present.</div><div class=""><br class=""></div><div class="">Second, this is Python's style, which comes at a cost: the grammar is not context free. While this type of grammar is safer, especially for programmers with little to no experience, the imposition on veteran programmers is constraining.</div><div class=""><br class=""></div><div class="">I realize that you're proposing that this be optional. However, this would introduce a new problem. Now you have two distinctly different styles of code out there. IMHO, this further increases the readability issue.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">-Patrick</div><div class=""><font face="Consolas" class=""><br class=""></font><div class=""><div><blockquote type="cite" class=""><div class="">On Dec 20, 2015, at 10:17 AM, Amir Michail 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="">// braces are optional here but you could still put them in if you want to<br class="">for i in 0..<10<br class=""> for j in 0..<5<br class=""> if i % 2 == 0<br class=""> print(i+j)<br class=""> print(i*j)<br class=""><br class="">// braces are necessary because “print" is on the same line as ”if"<br class="">for i in 0..<10<br class=""> for j in 0..<5<br class=""> if i % 2 == 0 { print(i+j) }<br class=""> print(i*j)<br class=""><br class="">// braces are necessary with incorrect/unconventional indentation<br class=""> for i in 0..<10 {<br class="">for j in 0..<5 {<br class="">if i % 2 == 0 {<br class="">print(i+j)<br class="">}<br class="">print(i*j)<br class="">}<br class="">}<br class=""><br class="">As for the space vs tab issue, my preference would be to allow only spaces to make braces optional. An alternative would be to use the python 3 indentation rules with respect to spaces and tabs.<br class="">_______________________________________________<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></div></blockquote></div><br class=""></div></div></body></html>