Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: David Brown Newsgroups: comp.lang.c Subject: Re: do { quit; } else { } Date: Sat, 12 Apr 2025 14:39:00 +0200 Organization: A noiseless patient Spider Lines: 36 Message-ID: References: <20250409142303.00004645@yahoo.com> <87ikndqabc.fsf@nosuchdomain.example.com> <20250410115501.000037a5@yahoo.com> <20250410080629.532@kylheku.com> <87a58mqt2o.fsf@nosuchdomain.example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 12 Apr 2025 14:39:02 +0200 (CEST) Injection-Info: dont-email.me; posting-host="ba46ccd2f72040b3ad67511223a21cf7"; logging-data="524516"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18CFuch1Hot1jypjw5RtxBHPp90DFhUuvc=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:Bl+/V8LVtzuu2KoVgbxtRcU+Xco= Content-Language: en-GB In-Reply-To: Bytes: 3057 On 12/04/2025 01:13, bart wrote: > On 11/04/2025 22:36, Keith Thompson wrote: >> bart writes: >> [...] >>> Rubbish. Everyone finds C declaration syntax a nightmare. >> >> Rubbish.  I find C declaration syntax annoying, not a "nightmare". >> > > Annoying would be having to get letter case or punctuation just right. > > But C typepecs can go far beyond it. I can just about do arrays of > pointers, or pointers to arrays. Anything more complicated is pretty > much trial and error. > > In an example in my post which I then deleted (DB will just ignore > examples), I wanted to create an array of 10 pointers to functions that > take an int and return an int. If only C had a way to make that simple and clear. Oh, wait - it does. typedef int (*FIntInt)(int); FIntInt funcs[10]; If a C programmer - such as yourself - is foolish enough to reject parts of the language designed to make coding simpler, safer, clearer and more portable, then I can see how your self-imposed restrictions make your coding harder. But the fault lies in the poor use of the language, not the language. (Typically you would give the function pointer type a name appropriate to its use rather than based on the parameter and return types - things like "keypress_event".)