Errors in TDPL

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Jun 23 08:24:40 PDT 2010


On 06/23/2010 02:11 AM, Rick Trelles wrote:
> Saving a keystroke, if it is in sound and clear way, is a plus.
> At least the option to save the keystroke should be maintained.
>
> I don't see now any advantages in using a pair of braces over a single
> semicolon for a null statement, but why not keep it both ways?

We've all seen that requiring "{}" after the likes of if, while etc. are 
very beneficial for readability. Then why not generalize that? As far as 
I can tell the only vestigial use of the lone ";" is with labels that 
don't precede any instruction (a very rare case). At this point, ";" 
needs more justification to stay than to go.

> I never liked the semicolon after while() but surely it wouldn't hurt to
> interpret it as a null statement for those who are used to it.
>
> By the way, I always glue the closing bracket to while
>
> do{
>
> . . .
>
> }while( . . . ) // plus ";" if coding in C
>
>
> Rick Trelles

That's great, except for those who enjoy "brace on its own line" 
formatting style. For those, the "}while" would look jarring.

Andrei


More information about the Digitalmars-d mailing list