Deutsch English Français Italiano |
<20240602124448.704@kylheku.com> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!weretis.net!feeder9.news.weretis.net!feeder8.news.weretis.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Kaz Kylheku <643-408-1753@kylheku.com> Newsgroups: comp.lang.c Subject: Re: C23 thoughts and opinions Date: Sun, 2 Jun 2024 19:52:22 -0000 (UTC) Organization: A noiseless patient Spider Lines: 25 Message-ID: <20240602124448.704@kylheku.com> References: <v2l828$18v7f$1@dont-email.me> <v2o57g$1t5p4$1@raubtier-asyl.eternal-september.org> <v3dkgh$2e0me$1@dont-email.me> <v3gou9$36n61$3@dont-email.me> <v3hrq7$1o743$1@news.xmission.com> <v3i7u3$3bp0v$1@dont-email.me> Injection-Date: Sun, 02 Jun 2024 21:52:22 +0200 (CEST) Injection-Info: dont-email.me; posting-host="f6f70ca8b1668588f62f241d96efb0ad"; logging-data="3676917"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/sFHrbdXFaQhVeifR9jAj0SMOsDA/OTyY=" User-Agent: slrn/pre1.0.4-9 (Linux) Cancel-Lock: sha1:O/4lOWYToslPvuzd4KL7E6/2MeY= Bytes: 2025 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. When Dennis Ritchie (if it was indeed he) chose for to be the construct in which the guard expression may be omitted, so that it may express conditional looping, he expressed the intent that it be henceforth used for that purpose. To continue to use while (1) after the proper utensil is provided is like to eat with your hands instead of a fork. -- TXR Programming Language: http://nongnu.org/txr Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal Mastodon: @Kazinator@mstdn.ca