Deutsch   English   Français   Italiano  
<20250421113640.839@kylheku.com>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Kaz Kylheku <643-408-1753@kylheku.com>
Newsgroups: comp.lang.c
Subject: Re: Loops (was Re: do { quit; } else { })
Date: Mon, 21 Apr 2025 18:43:40 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 40
Message-ID: <20250421113640.839@kylheku.com>
References: <vspbjh$8dvd$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> <vtnekn$1fogv$1@dont-email.me>
 <vto2mb$20c4n$1@dont-email.me> <vtu4i5$3hteg$1@dont-email.me>
 <vtujko$3uida$1@dont-email.me> <vtvfop$rf2p$1@dont-email.me>
 <vtvto2$15otp$1@dont-email.me> <vu01k7$1bfv2$1@dont-email.me>
 <vu0720$1dva7$1@dont-email.me> <vu2hmg$3jn88$1@dont-email.me>
 <vu2mkc$3noft$1@dont-email.me> <vu38da$735n$1@dont-email.me>
 <vu3j7s$g755$1@dont-email.me> <87ecxmv4t4.fsf@nosuchdomain.example.com>
 <vu401g$reom$1@dont-email.me> <20250420200823.908@kylheku.com>
 <vu5bqp$230jl$2@dont-email.me>
Injection-Date: Mon, 21 Apr 2025 20:43:40 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c13f5017c98192b6c07a0b629837b649";
	logging-data="2953068"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/nCEOd6SrvBqHuTLD00sXEtdl8WhMRNRE="
User-Agent: slrn/pre1.0.4-9 (Linux)
Cancel-Lock: sha1:aIaTdHChMsaaLuL9+FdAuANRiWo=

On 2025-04-21, bart <bc@freeuk.com> wrote:
> On 21/04/2025 04:16, Kaz Kylheku wrote:
> > - Because they are not gathered in one place, not only is it less> 
> readable, but we cannot use while write a macro such as:
>> 
>>       for_sqlite_hash (p, &pSchema->trigHash) {
>>         if (some_condition_over(p))
>>           continue; // doesn't stupidly repeat for the same p!
>>       }
>
> I can't write such macros at all. I'm not even sure what this does.

Have you never worked with a large codebase written by someone other
than you?

When you open a random file in an unfamiliar code base, pretty
much any function call that is not in the standard library triggers
the "I don't know what this does" response.

You have to learn some of that program's definitions in order to
effectively work with that program. At least those which are relevant to
your intended task.  You set up your "jump to definition" editor-fu and
start reading.

A loop macro like for_sqlite_hash (p, &pSchema->trigHash) is so obvious
that the only reason you'd look at its definition is to confirm that
it's not doing something stupid (which can be defined as just about
anything different from what it *looks* like it is doing).

> I'd call that a win!

Now you're calling the inability of the programmer to implement a
nice space-saving notation over something verbose a "win".

If so, why isn't "for (a; b; c)" also a "win" over "do i = x, y".

-- 
TXR Programming Language: http://nongnu.org/txr
Cygnal: Cygwin Native Application Library: http://kylheku.com/cygnal
Mastodon: @Kazinator@mstdn.ca