May 06, 2008 Re: why ; ? | ||||
|---|---|---|---|---|
| ||||
Tomasz Sowinski 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?
>
ECMAScript (JavaScript) allows this by making the terminating ';' optional, but you wind up with occasionally hard-to-find ambiguities as a result. You wind up falling back on using ';' everywhere as a habit just to avoid that problem. Requiring it, on the other hand, means that this problem never comes up.
As as part of D's philosophy is to reduce to program errors by language design, removing ';' would be somewhat against that goal. Even making it optional would be a bad move IMO. So I think it's here to stay.
| ||||
May 07, 2008 Re: why ; ? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Pragma | Pragma escribió:
> Tomasz Sowinski 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?
>>
>
> ECMAScript (JavaScript) allows this by making the terminating ';' optional, but you wind up with occasionally hard-to-find ambiguities as a result. You wind up falling back on using ';' everywhere as a habit just to avoid that problem. Requiring it, on the other hand, means that this problem never comes up.
>
> As as part of D's philosophy is to reduce to program errors by language design, removing ';' would be somewhat against that goal. Even making it optional would be a bad move IMO. So I think it's here to stay.
I fully agree.
--
Tom;
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply