Sujet : Re: Loops (was Re: do { quit; } else { })
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.lang.cDate : 16. Apr 2025, 13:08:37
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250416150837.00004587@yahoo.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
User-Agent : Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
On Wed, 16 Apr 2025 12:32:13 +0100
bart <
bc@freeuk.com> wrote:
But never, mind, C's for-loop will still be the most superior to
everybody here. I'd have an easier time arguing about religion!
>
Who exactly said that it is superior? Surely not me.
I think, most posters here would agree with my stance that C for() is
non-ideal. esp. for writer, but good enough.
And it has a minor advantage of being more clear for casual readers
than most "proper" counting loop. When counting loop is written as C
for() loop, a casual reader does not have to consult the manual about
meaning of the 1st, 2nd and 3rd (if present) parameters.
I don't know about you, may be your memory is perfect. Mine is not.
Even with python, a language that I use more often than once per year,
remembering whether range(3) means (0,1,2) or (0,1,2,3) is an effort.
Much more so with (modern) Fortran, that I read very rarely. In case of
Fortran, it certainly does not help that the principle of do loop is the
same as for loop in Matlab/Octave that I use regularly, but the order of
parameters differs.
Oh, now you could interpret a written above as statement of superiority
of C syntax. So, no, it is not. Those are *minor* points.