Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Tim Rentsch Newsgroups: comp.lang.c Subject: Re: C23 thoughts and opinions Date: Mon, 03 Jun 2024 13:31:38 -0700 Organization: A noiseless patient Spider Lines: 18 Message-ID: <864ja9ojit.fsf@linuxsc.com> References: <20240602124448.704@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Date: Mon, 03 Jun 2024 22:31:39 +0200 (CEST) Injection-Info: dont-email.me; posting-host="df68cad4d9500866e5e56f3de5ab6749"; logging-data="43441"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/TjdE5EOLpTpPkGoQax485vbFMWz9tmQs=" User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux) Cancel-Lock: sha1:aT4ZU0mPOcV8QpkSiIld1/IkUN4= sha1:LPlKqLsHkecfe2O9Zb7Ot6Unjlc= Bytes: 1810 Kaz Kylheku <643-408-1753@kylheku.com> writes: > On 2024-06-02, Lew Pitcher 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.