why ; ?
Bruce Adams
tortoise_74 at yeah.who.co.uk
Mon May 5 06:17:54 PDT 2008
On Mon, 05 May 2008 09:13:48 +0100, Tomasz Sowinski <tomeksowi at gmail.com>
wrote:
>
> Just another feature thought. Never gonna happen, but still...
>
> What's the reason of having lines end with a semicolon? Anything else
> than a legacy issue with C/C++?
>
> The only thing I can think of is having multiple statements in one line,
> but that only makes code unreadable. Wouldn't getting rid of ; improve
> readability?
>
>
> Tomek
There is always going to be a trade off between having to mark the end of
a statement using ";"
or having to escape newlines. Otherwise a language becomes horrendously
difficult to parse.
The rules for when you really need to end a statement would look even
stranger if you only needed
to do it for particular statements in particular contexts. Perhaps you
could have the best of both
worlds with a statementiser that knew more about typography and layout.
Then your heading back along
the python path. Either way the keep is simple rule applies. If its easier
for a compiler to grok
it might well be easier for a human to grok too and visa versa.
More information about the Digitalmars-d
mailing list