[swift-evolution] Proposal to remove semicolons

Chris Wood chris at interealtime.com
Thu Mar 17 10:44:13 CDT 2016


Paul


The semicolon is actually needed still to avoid accidental multi-line statements. E.g. these functions behave differently:


func doNothing1() {
    break
    print(“This text gets printed”)
}
func doNothing2() {
    break;
    print(“This text isn’t printed”)
}


Until odd cases like this can be avoided, I think semicolons are still (though very rarely) necessary.


Chris




> On Mar 17, 2016, at 3:25 PM, Paul Ossenbruggen <possen at gmail.com> wrote:
> 
> 
> +1 I think that let people do whatever they want if i makes them happy when it makes the code less readable is not a good idea. I support the notion that semicolon should not be allowed at end of line. It does nothing to help readability of the code. If it does nothing, it should go. Swift code should be easy to read, and in this case clarity wins. We have to break the semicolon habit :-) 
> 
> 
> Perhaps providing a warning fix-it which removes them from the end of all lines in the file. I suspect most cases the only reason people put it there is habit or they are converting old code from another language.
> 
> 
> - Paul
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160317/da5b2626/attachment.html>


More information about the swift-evolution mailing list