Re: while (1) vs. for ( ;; )
- From: Tim Rentsch <txr@xxxxxxxxxxxxxxxxxxx>
- Date: 30 Aug 2005 13:17:17 -0700
Richard Heathfield <invalid@xxxxxxxxxxxxxxx> writes:
> Tim Rentsch said:
>
>[snip]
>
> > My first reaction was that he's meaning to say that loops
> > that look infinite (but aren't) are bad,
>
> All else being equal, yes...
>
>
> > and the code should
> > be reworked so that the loop control expression is really
> > what controls the loop body.
>
> ...and yes.
>
> (This reply is purely for clarification of my earlier intent - I did read
> the rest of your article, and I accept that our viewpoints differ.)
Are they really different? What I said was that some loops
are better with the exit condition in the loop body rather
than the control expression; such loops don't occur
commonly. Do you really mean to say that _no_ loop, at any
time under any conditions, should be written with a constant
control expression? Not counting of course examples like
the microwave oven driver loop, which you explained already.
.
- References:
- while (1) vs. for ( ;; )
- From: Michael B Allen
- Re: while (1) vs. for ( ;; )
- From: Richard Heathfield
- Re: while (1) vs. for ( ;; )
- From: Tim Rentsch
- Re: while (1) vs. for ( ;; )
- From: Richard Heathfield
- while (1) vs. for ( ;; )
- Prev by Date: Re: low-level question
- Next by Date: Re: while (1) vs. for ( ;; )
- Previous by thread: Re: while (1) vs. for ( ;; )
- Next by thread: Re: while (1) vs. for ( ;; )
- Index(es):
Relevant Pages
|