consequences of removing semicolons in D like in Python
Sebastiaan Koppe via Digitalmars-d
digitalmars-d at puremagic.com
Sat Sep 17 02:09:44 PDT 2016
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.
> You might look into how javascript does it and what weirdness
> ensues as a result.
Its weird and uncomfortable at first, but there are only a
handful of characters that cause multiple lines to be interpreted
as one. Characters like [, (, +, - and ` (es6)
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.
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.
More information about the Digitalmars-d
mailing list