for in D versus C and C++
Rioshin an'Harthen
rharth75 at hotmail.com
Fri Mar 20 03:05:30 PDT 2009
"Walter Bright" <newshound1 at digitalmars.com> kirjoitti viestissä
news:gpu1sn$sn2$1 at digitalmars.com...
> Denis Koroskin wrote:
>> That was less than a week ago. I'd say that this type of bugs will live
>> as long as C++ lives.
>
> The thing is, even if the programmer *intended* to put the ; there, it
> looks like a bug to the maintenance programmer, and he has to spend extra
> effort determining if it was intended or not.
>
> I doubt anyone types { } by accident.
I have a habit of indenting the semicolon on the following line, if I wanted
a blank statement, like
for (...; ...; ...)
;
Much clearer in my opinion than having it on the same line as the for
construct.
More information about the Digitalmars-d
mailing list