Path: ...!news.misty.com!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Michael S Newsgroups: comp.lang.c Subject: Re: Loops (was Re: do { quit; } else { }) Date: Wed, 16 Apr 2025 15:08:37 +0300 Organization: A noiseless patient Spider Lines: 29 Message-ID: <20250416150837.00004587@yahoo.com> References: <20250413072027.219@kylheku.com> <20250415053852.166@kylheku.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Injection-Date: Wed, 16 Apr 2025 14:08:39 +0200 (CEST) Injection-Info: dont-email.me; posting-host="a5b6afe1e2db320795a254109bc9c05b"; logging-data="2209462"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+SMY4TuolfLT2Lv8WDP6EKrjnNdmMHXYY=" Cancel-Lock: sha1:ogNv4v/zcfrzjQbsruurM1u7UGk= X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32) Bytes: 2915 On Wed, 16 Apr 2025 12:32:13 +0100 bart 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.