[swift-evolution] Brace syntax
clattner at apple.com
Sat Dec 19 21:59:16 CST 2015
> On Dec 19, 2015, at 5:58 PM, Kevin Ballard via swift-evolution <swift-evolution at swift.org> wrote:
> There is not in fact an emphasis on conciseness. This has been repeated many times by the swift team. Conciseness is not a goal of Swift, but expressiveness absolutely is. Braces are a well-understood and simple way to express the notion of a scope/closure. And FWIW removing braces means you have to come up with a completely different syntax for closures, because indentation does not suffice there.
> Also, "don't be like C" is not even remotely a goal of Swift. The Swift syntax is C-like in many respects. "Be like C" isn't a goal either of course, but when deciding between two alternatives that have no compelling arguments either way, picking the one that would be more familiar to Obj-C programmers is usually a good idea.
Kevin got it exactly right, but I’d expand that last bit a bit to:
“… picking the one that is most familiar to programmers in the extended C family is a good idea.
I do agree that there are some benefits to ditching braces and relying on indentation instead, but there are also downsides. Deviating from the C family in this respect would have to provide *overwhelmingly* large advantages for us to take such a plunge, and they simply don’t exist.
More information about the swift-evolution