[swift-evolution] Brace syntax

Charles Constant charles at charlesism.com
Sat Dec 19 22:37:06 CST 2015


This entire thread is just beating dead horse. Having said that; why not
allow braces for closures, and disallow them elsewhere? It doesn't seem
like a deal-breaker, really. I don't think there's much to debate aside
from this: some people worry that significant whitespace makes code more
error-prone, and others feel the increased legibility makes it less
error-prone.

On Sat, 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 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
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151219/53a80c5b/attachment.html>


More information about the swift-evolution mailing list