Sujet : Re: C23 thoughts and opinions
De : gazelle (at) *nospam* shell.xmission.com (Kenny McCormack)
Groupes : comp.lang.cDate : 03. Jun 2024, 22:48:23
Autres entêtes
Organisation : The official candy of the new Millennium
Message-ID : <v3ldn7$1pr90$1@news.xmission.com>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
v3lb0u$2452$1@dont-email.me>,
Chris M. Thomasson <
chris.m.thomasson.1@gmail.com> wrote:
On 6/3/2024 1:31 PM, Tim Rentsch wrote:
Kaz Kylheku <643-408-1753@kylheku.com> writes:
On 2024-06-02, Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
>
I've always considered
for (;;)
preferable over
while (1)
>
Of course it is preferable. The idiom constitutes the language's direct
support for unconditional looping, not requiring that to be requested by
an extraneous always-true expression.
>
Using while (1) or while (true) is like i = i + 1 instead
of ++i, or while (*dst++ = *src++); instead of strcpy. [...]
Using for (;;) for an infinite loop is an abomination. Anyone
who advocates following that rule is an instrument of Satan.
>
Better than goto? ;^D
I can't believe we're still having this conversation.
Surely, on any reasonably modern compiler, all three forms will generate
exactly the same code.
-- You are again heaping damnation upon your own head by your statements. - Rick C Hodgin -