[swift-evolution] Proposal to remove semicolons

Paul Cantrell cantrell at pobox.com
Mon Dec 14 12:18:24 CST 2015


+1 to “better handled by a linter.” As with the “required self.” proposal, this seems better suited to an external style checker than to a language rule.

SwiftLint can already generate warnings and errors that look exactly like compiler errors in Xcode for those who want the seamlessness of a language rule.

If the language provides a construct, there are always unforeseen consequences to not providing it in its full generality, even when good style dictates narrower usage. For example: this proposal might complicate Swift code generation. I know, code generation, who wants that, yuck, right? But there are time when it’s the right solution, and being able to just concatenate things with terminating semicolons and not have worry about an arbitrary EOL rule would make a generator’s job easier.

Cheers, P

> On Dec 14, 2015, at 12:04 PM, Arthur Ariel Sabintsev via swift-evolution <swift-evolution at swift.org> wrote:
> 
> I'm also game for making them invalid syntax. 
> 
> The only time I've seen `;` in my code is from my old Obj-C habit.
> 
> On Mon, Dec 14, 2015 at 12:25 PM Austin Zheng via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> Semicolons are already optional at the end of lines and only required to separate multiple statements on the same line (and for C for loops, but changing the grammar of those or removing them is a different topic.
> 
> If your proposal is to make a semicolon at the end of a single line invalid syntax, that's fine with me, although it seems like an unnecessarily small change to the grammar (and something better handled by a linter). If your proposal is to remove the semicolon as a way to separate multiple statements on the single line, then -1.
> 
> Austin
> 
> > On Dec 13, 2015, at 6:12 AM, João Nunes via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> >
> > Hi,
> >
> > I submitted a PR with a proposal to remove the swift end of line semicolons.
> >
> > It was rejected because i didn't discuss it here. So here i'm discussing it :)
> >
> > My proposal is simple: remove the semicolons in the end of lines.
> > It isn't needed and makes the code ugly.
> > It must be decided wether to use it or not for every project we start in the coding style.
> >
> > What do you think?
> >
> > João Nunes
> >
> >
> > Sent from my iPhone
> > _______________________________________________
> > swift-evolution mailing list
> > swift-evolution at swift.org <mailto:swift-evolution at swift.org>
> > https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
> -- 
> Best,
> 
> Arthur / Sabintsev.com
>  _______________________________________________
> 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/20151214/5ce78eea/attachment.html>


More information about the swift-evolution mailing list