Path: ...!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: bart Newsgroups: comp.lang.c Subject: Re: Loops (was Re: do { quit; } else { }) Date: Tue, 22 Apr 2025 01:26:39 +0100 Organization: A noiseless patient Spider Lines: 37 Message-ID: References: <874iyh153g.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 22 Apr 2025 02:26:39 +0200 (CEST) Injection-Info: dont-email.me; posting-host="d044c27b80dbbae3d03ebae8688adc0f"; logging-data="3499944"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/fPSSJ7ioAc83IlkzYyOyO" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:ppcQIvheYnoSq9q02iNb9+IhlIw= In-Reply-To: <874iyh153g.fsf@nosuchdomain.example.com> Content-Language: en-GB Bytes: 2981 On 22/04/2025 00:12, Keith Thompson wrote: > bart writes: >> On 21/04/2025 22:06, Waldek Hebisch wrote: >>> bart wrote: >> >> t iteration goes over all elements in the hash table. >>> BTW2: When looking at 'for' loop you are supposed to see pattern, >>> without need to track all steps. >> >> That's one of the disadvantages of using the same, often >> /inappropriate/ keyword for every kind of pattern. > > You think it's inappropriate. > > Would your objections go away if a different keyword were used? I already said that I would have prefered if 'while' was used. Then either 'for' wasn't used, or was used for the kind of for-loop that is common in other languages. > *You* find it much cleaner and simpler. I don't. What makes you right > and everyone else wrong? This is an interesting point: too much stuff on one line is usually frowned upon: multiple statements, multiple variables being declared etc. But when it's a for-loop, then apparently anything goes. > All three would be IMHO clearer if each of the three clauses were on a > separate line. The fact that you can write a badly formatted C-style > for loop is not an argument against C-style for loops. Complex loops are nearly always badly formatted and written on one line. Nobody cares. As you've demonstrated.