consequences of removing semicolons in D like in Python

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 17 04:03:14 PDT 2016


On Saturday, September 17, 2016 10:15:57 eugene via Digitalmars-d wrote:
> On Saturday, 17 September 2016 at 02:21:54 UTC, Chris M. wrote:
> > Pointless and not worth breaking everyone's code over
>
> why?

Having semicolons actually serves as a synchronization point for the
compiler, which helps it give better error messages. Sure, trying to use
newlines that way can work, but it's more problematic - especially when you
take stuff like multiline statements into account. D - like C/C++/Java/C# -
is not whitespace sensitive, and like those languages, it uses semicolons.
There really is no technical reason why getting rid of semicolons improves
things, and it does make them at least slightly worse as far as the compiler
goes. It's just cleaner to have semicolons, and most D programmers have no
problem with that - even prefer it.

In addition, needlessly altering D's syntax like that would make porting
C/C++ code to it much harder, which would be a significant problem for a
decent chunk of our user base. D's syntax tends to stick with C/C++'s syntax
unless it has a compelling reason to do otherwise.

And regardless of whether not having semicolons would be better or not, it
would be a huge breaking change to get rid of them, which isn't even vaguely
worth it. Sure, D continues to involve, but it's reasonably stable, and we
want it to become _more_ stable, not less. It's _way_ past the point that we
would consider making a change like this. Doing something like removing
semicolons from the language would alienate a huge portion of our user base.
Most would consider the change to be objectively worse, and even if they
didn't care about whether D had semicolons or not, they would _not_ be
pleased to have their code break.

- Jonathan M Davis



More information about the Digitalmars-d mailing list