[swift-evolution] Brace syntax
Kevin Ballard
kevin at sb.org
Sat Dec 19 19:58:02 CST 2015
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 Ballard
On Sat, Dec 19, 2015, at 05:39 PM, Alexander Regueiro via swift-evolution wrote:
> Has anyone considered removing braces from the Swift language? The main alternative would be indentation-based scoping like in Python or Ruby. There already seems to be a general emphasis on conciseness, lack of redundancy, and a modern syntax. e.g. semicolons are not required for single-line statements; brackets have been removed from if/for/while expressions, compared to C-style syntax. So, why not go the whole way in breaking the C-style connection? The present syntax seems to be shunning C, but only slightly.
>
> Thoughts?
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
More information about the swift-evolution
mailing list