[swift-evolution] Proposal to remove semicolons
João Nunes
joao3001 at hotmail.com
Mon Dec 14 17:12:56 CST 2015
For the one asking the pr link: https://github.com/apple/swift-evolution/pull/57
The semicolon in C style loops will soon be removed. So no point in defending it. Also it was out of the scope of this proposal.
In my opinion having an optional line termination just adds confusion for new comers. And adds near 0 value to the language .
Similar to the c style loop and the ++ and -- operators, it is just old carried over stuff.
My point is, swift is a modern language, semicolons aren't . The minimal advantage of it can be easily counter-argumented. It is a natural evolutionary step to remove the semicolon in the end of the lines.
Joao
Sent from my iPhone
> On 14 Dec 2015, at 20:01, Chris Lattner <clattner at apple.com> wrote:
>
> There are two different topics here, and I’d suggest exploring them separately.
>
> - The semicolon within a line is a expressivity feature.
> - The semicolon at the end of the line is accepted, but generally ignored.
>
> Most people seem to be focusing on the second one. IMO, I think that it adds value to the language for people coming from semi-colon oriented languages or bouncing between multiple languages (that muscle memory takes awhile to break). OTOH, it is just syntactic noise (along with redundant parens in conditions and many other things), and so having a warning (probably opt-in) for it would make sense to me.
>
> -Chris
>
>> On Dec 14, 2015, at 10:55 AM, Colin Cornaby via swift-evolution <swift-evolution at swift.org> wrote:
>>
>> It does seem odd there is a large focus on removing C style language features from Swift, but that the semi colon is still around.
>>
>> I'd be in favor of making them invalid syntax on single statement lines. It reduces confusion/code style arguments. I've stopped using them in Swift. They don't do anything on single statement lines, why bother?
>>
>>> On Dec 14, 2015, at 10:04 AM, 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> 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> 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
>>>> > 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
>>>
>>> --
>>> Best,
>>>
>>> Arthur / Sabintsev.com
>>>
>>> _______________________________________________
>>> 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/20151215/8fdf413c/attachment.html>
More information about the swift-evolution
mailing list