Groups | Search | Server Info | Login | Register


Groups > comp.lang.c > #393414

Re: Loops (was Re: do { quit; } else { })

Path csiph.com!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From Tim Rentsch <tr.17687@z991.linuxsc.com>
Newsgroups comp.lang.c
Subject Re: Loops (was Re: do { quit; } else { })
Date Wed, 14 May 2025 11:09:51 -0700
Organization A noiseless patient Spider
Lines 36
Message-ID <86sel7ukr4.fsf@linuxsc.com> (permalink)
References <vspbjh$8dvd$1@dont-email.me> <vtc7mp$2q5hr$1@dont-email.me> <vtcqf6$3j95s$1@dont-email.me> <vtdh4q$b3kt$1@dont-email.me> <vtf7fe$1qtpg$1@dont-email.me> <vtgfuf$31ug1$1@dont-email.me> <20250413072027.219@kylheku.com> <vtgpce$39229$1@dont-email.me> <vti2ki$g23v$1@dont-email.me> <vtin99$vu24$1@dont-email.me> <vtiuf0$18au8$1@dont-email.me> <vtj97r$1i3v3$1@dont-email.me> <vtl166$36p6b$1@dont-email.me> <vtlcg0$3f46a$2@dont-email.me> <20250415153419.00004cf7@yahoo.com> <86h62078i8.fsf@linuxsc.com> <20250504180833.00000906@yahoo.com> <86plggzilx.fsf@linuxsc.com> <20250511010917.00007702@yahoo.com> <86h61qzn55.fsf@linuxsc.com> <20250512161819.000023d6@yahoo.com>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Date Wed, 14 May 2025 20:09:59 +0200 (CEST)
Injection-Info dont-email.me; posting-host="adcc0210618ce5c814d2d263cc71a7bf"; logging-data="2774377"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Gu4SXg4o+afx6jGSdNrjKHQcdORF9ypo="
User-Agent Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock sha1:qvKONiPRYMel96IGF0AdFcF/gDA= sha1:H0M54pv3FU/Ef/XIrdo0I2IYi0o=
Xref csiph.com comp.lang.c:393414

Show key headers only | View raw


Michael S <already5chosen@yahoo.com> writes:

(I am summarizing heavily in an effort to return to the main area
of interest.)

> On Sun, 11 May 2025 17:30:14 -0700
> Tim Rentsch <tr.17687@z991.linuxsc.com> wrote:
>
>> Michael S <already5chosen@yahoo.com> writes:

[...]

>>> [suggestion to keep for() and eliminate while()]
>>
>> [a mention was made of statistics given in another posting
>>  that reported a ratio of while()/for() of roughly 2.3 to 1.]
>>
>>>>>> [upthread there was a different posting, from Richard
>>>>>>  Heathfield, that gave statistics reflecting a ratio
>>>>>>  of for()/while() of approximately 3 to 1, IIRC]

I did a more comprehensive gathering of statistics, using an ad hoc
collection of 68 open source projects, ranging in size from just
over 1500 lines to over a million lines, including two outliers
with 20 million lines and 75 million lines.  The ratio of while()
to do/while() ranged from 12.5% to 2100%, with an average of
573.9%.  The ratio of while() to for() ranged from 1.6% to 300%,
with an average of 60.8%.

> [...] while() does not help anything relatively to for().

I understand that that is your view.  I don't remember seeing any
supporting statements other than your personal reactions.  My own
experience is different.  Judging by the open source statistics
reported above, it appears that a fair number of other developers
don't share your views on this question either.

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-04 07:31 -0700
  Re: Loops (was Re: do { quit; } else { }) Michael S <already5chosen@yahoo.com> - 2025-05-04 18:08 +0300
    Re: Loops (was Re: do { quit; } else { }) Michael S <already5chosen@yahoo.com> - 2025-05-05 10:42 +0300
    Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-10 06:43 -0700
      Re: Loops (was Re: do { quit; } else { }) Muttley@dastardlyhq.com - 2025-05-10 15:56 +0000
        Re: Loops (was Re: do { quit; } else { }) scott@slp53.sl.home (Scott Lurndal) - 2025-05-10 17:48 +0000
          Re: Loops (was Re: do { quit; } else { }) Muttley@dastardlyhq.com - 2025-05-11 08:20 +0000
        Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-10 14:29 -0700
          Re: Loops (was Re: do { quit; } else { }) Muttley@dastardlyhq.com - 2025-05-11 08:21 +0000
            Re: Loops (was Re: do { quit; } else { }) David Brown <david.brown@hesbynett.no> - 2025-05-11 12:02 +0200
              Re: Loops (was Re: do { quit; } else { }) Muttley@dastardlyhq.com - 2025-05-11 15:30 +0000
                Re: Loops (was Re: do { quit; } else { }) scott@slp53.sl.home (Scott Lurndal) - 2025-05-11 16:29 +0000
                Re: Loops (was Re: do { quit; } else { }) David Brown <david.brown@hesbynett.no> - 2025-05-11 18:49 +0200
              Re: Loops (was Re: do { quit; } else { }) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-05-11 14:41 -0700
              Re: Loops (was Re: do { quit; } else { }) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-05-11 17:43 -0400
                Re: Loops (was Re: do { quit; } else { }) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-05-11 15:06 -0700
                Re: Loops (was Re: do { quit; } else { }) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-05-11 18:30 -0400
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-11 18:15 -0700
                Re: Loops (was Re: do { quit; } else { }) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-05-11 19:09 -0700
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-12 00:16 -0700
                Re: Loops (was Re: do { quit; } else { }) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-05-12 02:23 -0700
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-12 07:19 -0700
                Re: Loops (was Re: do { quit; } else { }) Richard Heathfield <rjh@cpax.org.uk> - 2025-05-12 15:34 +0100
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-12 22:42 -0700
                Re: Loops (was Re: do { quit; } else { }) Richard Heathfield <rjh@cpax.org.uk> - 2025-05-13 07:31 +0100
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-14 21:12 -0700
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-13 09:30 -0700
                Re: Loops (was Re: do { quit; } else { }) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-05-13 22:28 +0200
                Re: Loops (was Re: do { quit; } else { }) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-05-12 13:31 -0700
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-14 20:44 -0700
                Re: Loops (was Re: do { quit; } else { }) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-05-14 21:45 -0700
                Re: Loops (was Re: do { quit; } else { }) David Brown <david.brown@hesbynett.no> - 2025-05-12 17:24 +0200
                Re: Loops (was Re: do { quit; } else { }) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-05-12 00:07 -0400
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-12 00:43 -0700
                Re: Loops (was Re: do { quit; } else { }) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-05-12 02:27 -0700
                Re: Loops (was Re: do { quit; } else { }) David Brown <david.brown@hesbynett.no> - 2025-05-12 17:18 +0200
                Re: Loops (was Re: do { quit; } else { }) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-05-12 19:53 -0400
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-12 23:03 -0700
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-12 19:04 -0700
                Re: Loops (was Re: do { quit; } else { }) David Brown <david.brown@hesbynett.no> - 2025-05-12 17:08 +0200
                Re: Loops (was Re: do { quit; } else { }) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-05-12 13:38 -0700
                Re: Loops (was Re: do { quit; } else { }) David Brown <david.brown@hesbynett.no> - 2025-05-13 12:41 +0200
                Re: Loops (was Re: do { quit; } else { }) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-05-13 23:16 +0200
                Re: Loops (was Re: do { quit; } else { }) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-05-13 14:35 -0700
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-13 15:10 -0700
                Re: Loops (was Re: do { quit; } else { }) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-05-13 15:41 -0700
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-13 18:38 -0700
                Re: Loops (was Re: do { quit; } else { }) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-05-13 19:37 -0700
                Re: Loops (was Re: do { quit; } else { }) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-05-13 23:54 -0400
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-13 21:19 -0700
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-13 21:12 -0700
                Re: Loops (was Re: do { quit; } else { }) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-05-13 22:38 -0700
                Re: Loops (was Re: do { quit; } else { }) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-05-14 03:35 +0000
                Re: Loops (was Re: do { quit; } else { }) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-05-13 21:54 -0700
                Re: Loops (was Re: do { quit; } else { }) Kaz Kylheku <643-408-1753@kylheku.com> - 2025-05-14 06:31 +0000
                Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-06-10 06:01 -0700
                Re: Loops (was Re: do { quit; } else { }) Bonita Montero <Bonita.Montero@gmail.com> - 2025-06-14 12:24 +0200
                Re: Loops (was Re: do { quit; } else { }) scott@slp53.sl.home (Scott Lurndal) - 2025-06-14 13:57 +0000
                Re: Loops (was Re: do { quit; } else { }) Michael S <already5chosen@yahoo.com> - 2025-06-14 22:27 +0300
                Re: Loops (was Re: do { quit; } else { }) Bonita Montero <Bonita.Montero@gmail.com> - 2025-06-15 09:32 +0200
                Re: Loops (was Re: do { quit; } else { }) David Brown <david.brown@hesbynett.no> - 2025-05-14 13:00 +0200
                Re: Loops (was Re: do { quit; } else { }) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-05-14 13:20 +0200
                Re: Loops (was Re: do { quit; } else { }) James Kuyper <jameskuyper@alumni.caltech.edu> - 2025-05-14 23:20 -0400
                Re: Loops (was Re: do { quit; } else { }) David Brown <david.brown@hesbynett.no> - 2025-05-15 11:23 +0200
            Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-11 17:59 -0700
              Re: Loops (was Re: do { quit; } else { }) Muttley@DastardlyHQ.org - 2025-05-12 10:11 +0000
                Re: Loops (was Re: do { quit; } else { }) Michael S <already5chosen@yahoo.com> - 2025-05-12 17:09 +0300
      Re: Loops (was Re: do { quit; } else { }) Michael S <already5chosen@yahoo.com> - 2025-05-11 01:09 +0300
        Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-11 17:30 -0700
          Re: Loops (was Re: do { quit; } else { }) Michael S <already5chosen@yahoo.com> - 2025-05-12 16:18 +0300
            Re: Loops (was Re: do { quit; } else { }) Tim Rentsch <tr.17687@z991.linuxsc.com> - 2025-05-14 11:09 -0700
          Re: Loops (was Re: do { quit; } else { }) Janis Papanagnou <janis_papanagnou+ng@hotmail.com> - 2025-05-13 15:57 +0200
  Re: Loops (was Re: do { quit; } else { }) Keith Thompson <Keith.S.Thompson+u@gmail.com> - 2025-05-04 13:52 -0700

csiph-web