Re: while (1) vs. for ( ;; )
- From: Richard Heathfield <invalid@xxxxxxxxxxxxxxx>
- Date: Mon, 29 Aug 2005 18:35:12 +0000 (UTC)
Alan Balmer said:
> On Mon, 29 Aug 2005 08:42:47 +0000 (UTC), Richard Heathfield
> <invalid@xxxxxxxxxxxxxxx> wrote:
>
>>Personally, I prefer neither choice! I would rather have the loop control
>>statement explicitly document the exit condition (unless there genuinely
>>isn't one, such as might be the case in an electronic appliance like a
>>microwave oven, where "forever" can roughly be translated as "whilst power
>>is being supplied to the appliance").
>
> It often happens that there are multiple exit conditions. Is it your
> preference to set a "get out" flag for these situations?
Yes: done = 1;
> That's my
> preference, though I don't feel strongly about it (and I'm likely to
> use multiple function returns, too, when a single return is too
> contrived.)
I'm quite unlikely to use multiple returns, although I seem to recall that I
have done so on occasion, when in a tearing hurry.
--
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: Christopher Benson-Manica
- Re: while (1) vs. for ( ;; )
- From: Alan Balmer
- 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: Alan Balmer
- while (1) vs. for ( ;; )
- Prev by Date: Re: Parity check of a word
- Next by Date: Re: Style isn't always religious
- Previous by thread: Re: while (1) vs. for ( ;; )
- Next by thread: Re: while (1) vs. for ( ;; )
- Index(es):
Relevant Pages
|