Re: while (1) vs. for ( ;; )
- From: Richard Heathfield <invalid@xxxxxxxxxxxxxxx>
- Date: Tue, 30 Aug 2005 19:59:01 +0000 (UTC)
Tim Rentsch said:
> What Richard might be saying, but isn't really what I think
> he's trying to say, is that the control expression should
> redundantly express the condition for loop exit, even if the
> loop is never exited by the test on the loop control.
No, I'm saying I could put up with
for(;;)
{
fetch_microwave_command(&foo);
execute_microwave_command(&foo);
}
because it's quite evident that this is a genuinely "infinite" loop, in the
limited sense of that word applicable to a microwave oven!
> 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.)
--
Richard Heathfield
"Usenet is a strange place" - dmr 29 July 1999
http://www.cpax.org.uk
Email rjh at the above domain
.
- Follow-Ups:
- Re: while (1) vs. for ( ;; )
- From: Tim Rentsch
- Re: while (1) vs. for ( ;; )
- 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
- while (1) vs. for ( ;; )
- Prev by Date: Re: Function pointer prototype interpretation
- 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
|