[swift-evolution] Optional "endfor", "endif", etc after closing "}"

Thorsten Seitz tseitz42 at icloud.com
Sat Dec 12 11:51:59 CST 2015


> Am 12.12.2015 um 14:41 schrieb Al Skipp via swift-evolution <swift-evolution at swift.org>:
> 
> 
>> On 12 Dec 2015, at 13:31, Marc Knaup via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
>> 
>> I'm also against any kind of markers to annotate the end of a block.
>> 
>> If the code inside a if/guard/loop/do/func/var/… block is so long that the developer thinks about annotating the closing curly brace then they should instead break it down into smaller pieces. Move parts into separate functions and replace it with calls to these functions.
>> This makes the block shorter, much easier to understand and the function names will aid as additional documentation.
> 
> I completely agree. 
> 
> If code becomes so impenetrable that you need to annotate the end of blocks to assist comprehension, then the code needs refactoring. Adding a syntactical crutch that encourages you to chop off your own leg, doesn’t seem like a good idea.

I completely agree with Marc and Al.

-Thorsten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151212/23b622b6/attachment.html>


More information about the swift-evolution mailing list