Warning: mysqli::__construct(): (HY000/1203): User howardkn already has more than 'max_user_connections' active connections in D:\Inetpub\vhosts\howardknight.net\al.howardknight.net\includes\artfuncs.php on line 21
Failed to connect to MySQL: (1203) User howardkn already has more than 'max_user_connections' active connectionsPath: ...!news.snarked.org!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail From: gazelle@shell.xmission.com (Kenny McCormack) Newsgroups: comp.lang.c Subject: Re: Loops (was Re: do { quit; } else { }) Date: Sun, 20 Apr 2025 23:19:37 -0000 (UTC) Organization: The official candy of the new Millennium Message-ID: References: <87ldruv65j.fsf@nosuchdomain.example.com> Injection-Date: Sun, 20 Apr 2025 23:19:37 -0000 (UTC) Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4"; logging-data="2156055"; mail-complaints-to="abuse@xmission.com" X-Newsreader: trn 4.0-test77 (Sep 1, 2010) Originator: gazelle@shell.xmission.com (Kenny McCormack) Bytes: 2053 Lines: 31 In article <87ldruv65j.fsf@nosuchdomain.example.com>, Keith Thompson wrote: .... >I understand and completely accept that you find the while loop >clearer, and I have no interest in changing your mind. > >I find the for loop clearer. I won't speak for anyone else, but I >suspect a lot of C programmers would also find the for loop clearer. I'm with Bart on this one. I think "for" loops that aren't simple iterations (i.e., do this thing 10 times), are harder to understand than the equivalent "while" loop. I.e., this: p = someComplexFunctionCall(this,that,the,other,thing); while (p) { do stuff; p = getNewValue(p); } is a lot easier to understand at first glance than the equivalent: for (p = someComplexFunctionCall(this,that,the,other,thing); p; p = getNewValue(p)) do stuff; But, having said that, I'll always write the "for" version, because I like writing compact (some would say "cryptic") code. Job security, and all that... -- Meatball Ron wants to replace the phrase "climate change" with the phrase "energy dominance" in policy discussions. Yeah, like that makes a lot of sense...