[swift-evolution] Proposal: Make braces optional much like semicolons.
a.michail at me.com
Sun Dec 20 11:01:44 CST 2015
> On Dec 20, 2015, at 11:52 AM, Craig Cruden via swift-evolution <swift-evolution at swift.org> wrote:
> Although I am not for braces being optional and using tab / indentation for scope, the forcing of using braces for one line scopes is overkill IMHO.
I absolutely support the use of braces for one line scopes. This prevents bugs.
When making braces optional via indentation, I would still want them to be required for one line scopes.
> If there is scope that is multiline though I would probably include scope on all of them (there is one multi-line scope in that example).
> So +1 / -1 at the same time (which I guess sums out to 0) :p
>> On 2015-12-20, at 23:44:55, Bart Whiteley via swift-evolution <swift-evolution at swift.org> wrote:
>> On Sun, Dec 20, 2015 at 8:17 AM, Amir Michail via swift-evolution
>> <swift-evolution at swift.org> wrote:
>>> // braces are optional here but you could still put them in if you want to
>>> for i in 0..<10
>>> for j in 0..<5
>>> if i % 2 == 0
>> -1. Please no. The fact that Swift requires curly braces even in
>> situations where C does not is a great feature. I still remember the
>> cheer that erupted from the '14 WWDC crowd when mandatory braces were
>> announced -- and rightfully so. Many bugs are prevented by mandatory
>> swift-evolution mailing list
>> swift-evolution at swift.org
> swift-evolution mailing list
> swift-evolution at swift.org
More information about the swift-evolution