consequences of removing semicolons in D like in Python

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 17 07:19:40 PDT 2016


On Sat, 17 Sep 2016 09:09:44 +0000, Sebastiaan Koppe wrote:

> On Saturday, 17 September 2016 at 05:03:17 UTC, Chris Wright wrote:
>> someObject.someField.someLongMethodName(
>>   arg1, arg2, arg3);
> There are no semicolons in an ArgumentList.

Thank you for repeating my point, that you have to look at the grammar to 
see where a semicolon could appear and not just insert a semicolon at 
every newline.

>> You might look into how javascript does it and what weirdness ensues as
>> a result.
> [...]
>
> Where it gets a little bit weird is with return statements for instance,
> since there can be no newline before the expression to be returned.
> Arrow functions, while statements, etc. have similar constraints. All
> pretty obvious once you know the rules.
> 
> That is pretty much it.

Sounds reasonable. So it's not likely to be a huge problem except for 
existing code.

> Having said all that, I do think a much better solution to avoid the
> visual clutter is to make the semicolon transparent in the syntax
> highlighting.

That's okay for reading code that you know compiles, not so great for 
writing code that might have a missing semicolon.


More information about the Digitalmars-d mailing list