Sujet : Re: encapsulating directory operations
De : rjh (at) *nospam* cpax.org.uk (Richard Heathfield)
Groupes : comp.lang.cDate : 20. May 2025, 19:50:06
Autres entêtes
Organisation : Fix this later
Message-ID : <100iisu$2au2n$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Mozilla Thunderbird
On 20/05/2025 18:51, Scott Lurndal wrote:
Richard Heathfield <rjh@cpax.org.uk> writes:
On 20/05/2025 18:14, Kaz Kylheku wrote:
On 2025-05-20, Richard Heathfield <rjh@cpax.org.uk> wrote:
On 20/05/2025 17:19, David Brown wrote:
While there are some people who, for reasons that still escape
me, prefer C90 over C99
>
I will not fight you, David.
>
// For some reason that escapes me, I have a crash.
>
char *me(void)
{
char reason[42];
return reason;
}
>
Don't give up the day job, Kaz. ;-)
>
Sure, you can do stupid things in any dialect of C.
>
I think it was Doug Gwyn who said that if you set out to make it
impossible to do stupid things in C, you'll end up making it
impossible to do clever things.
Define "clever" in this context. Duff's Device?
:-)
I doubt very much whether that's what Doug Gwyn had in mind. He always struck me as being a very level-headed fellow. He'd have been talking about wise-clever, not smartarse-clever.
But nosing around the Web, I have discovered that he was talking not about C but about Unix. <oh well>
Most "clever" code often ends up being not very maintainable in the
long run, or sometimes is broken by a simple architectural enhancement.
Certainly true. I once wrote a stunningly clever program in a 4GL - something to be really proud of. (Okay, so I was being a smart-arse, but in a good way.)
Dan was tasked with a modification that didn't fit into my quite brilliant scheme. He had to rip it apart and start from scratch. He told me he felt like a barbarian at the gates of Rome, but the job comes first, of course,and so Rome burned. Ah well.
As for Kaz's bug, I have enough confidence in Kaz to be sure that he wouldn't be so damn stupid in real code. I don't suppose you would be either, and I'd like to think that I'm better than that too.
If we have to be hand-held through what we can and cannot do with local objects, we have no business writing production code.
-- Richard HeathfieldEmail: rjh at cpax dot org dot uk"Usenet is a strange place" - dmr 29 July 1999Sig line 4 vacant - apply within