Re: while (1) vs. for ( ;; )



Charlie Gordon wrote:
"Chris McDonald" <chris@xxxxxxxxxxxxxxx> wrote in message
news:detv2b$ael$1@xxxxxxxxxxxxxxxxxx

Ben Pfaff <blp@xxxxxxxxxxxxxxx> writes:

I would suggest that both while(1) and for(;;) are potentially unclear
to a person (undergrad. student) seeing C for the first time
(while assuming they haven't seen Java or C++, either).

OK, I suggest that while(true) is *clearer*.


BS

why not use the real clear thing :

WHILE (TRUE) {
}

or even

WHILE (TRUE == TRUE)
BEGIN
    ...
END

with obvious macro definitions for dummies ;-)


In variable and function declarations the virtues of stdbool.h is clear. Compare


   int isThisAPredicate;

and

   bool thisMustBeAPredicate;


August .



Relevant Pages

  • Re: while (1) vs. for ( ;; )
    ... > I would suggest that both whileand forare potentially unclear ... > to a person (undergrad. ... student) seeing C for the first time ...
    (comp.lang.c)
  • Re: while (1) vs. for ( ;; )
    ... > I would suggest that both whileand forare potentially unclear ... > to a person (undergrad. ... student) seeing C for the first time ...
    (comp.lang.c)
  • Re: while (1) vs. for ( ;; )
    ... > I would suggest that both whileand forare potentially unclear ... > to a person (undergrad. ... student) seeing C for the first time ...
    (comp.lang.c)
  • Re: while (1) vs. for ( ;; )
    ... > to a person (undergrad. ... student) seeing C for the first time ... > (while assuming they haven't seen Java or C++, ...
    (comp.lang.c)
  • Re: while (1) vs. for ( ;; )
    ... to a person (undergrad. ... student) seeing C for the first time (while assuming they haven't seen Java or C++, ...
    (comp.lang.c)