[swift-evolution] [swift-evolution-announce] [Review] SE-0099: Restructuring Condition Clauses
brent at architechies.com
Mon May 30 17:54:56 CDT 2016
> Thanks everyone. FYI, Erica and I discussed it offlist and agreed to amend the proposal: now you can use semicolons or a newline to separate clauses of different types.
This change does not alter my concern about the overloading of the semicolon as a statement separator, and in fact, it introduces new ones about code formatting. Putting newlines in the middle of a compound conditional has always led to awkward questions about how deeply you should indent the conditions, the curly bracket or `else` keyword, and the contents of the block. Syntactically encouraging *every* compound conditional to use newlines, as you propose, only makes this issue worse.
I continue to believe that, however complicated it may be for the compiler, the right answer is to use `&&`, which expresses the desired semantic. Barring that, I prefer the current situation, messy as it may be, to this proposal. I simply cannot support overloading something as fundamental to the language as its statement separators (`;` and newline), even if the compiler can tell the difference. It was a mistake in the C-style for loop and it would be a mistake here as well.
More information about the swift-evolution