Path: csiph.com!news.mixmin.net!eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: "Catch-23: The New C Standard,Sets the World on Fire" by Terence Kelly with Special Guest Borer Yekai Pan
Date: Tue, 02 May 2023 07:12:02 -0700
Organization: A noiseless patient Spider
Lines: 21
Message-ID: <86mt2m2571.fsf@linuxsc.com>
References: <87zg7n89zw.fsf@bsb.me.uk> <87leirkotx.fsf@zotaspaz.fatphil.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="a5ed23c0072bcec5fb0daec640c9c411"; logging-data="839765"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18PCxF4rY/Qg6Mr+4/B3tyQWnlo1qAAv3Q="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:5SOwZNbFel5t2Hk5jxjMsWe7dBs= sha1:nDOfHZRUwe28YrdVzMXiORmH8k8=
Xref: csiph.com comp.lang.c:170165
Phil Carmody writes:
[...]
> However, oh my, that example code they include is almost comically
> ugly, and I'd even go as far as to say unidiomatic for the language:
> https://dl.acm.org/cms/attachment/html/
> 10.1145/3588242/assets/html/db9_fig1.png
> That's even more hilarious given their later emphasis on use of
> idioms.
The code in the paper is written not to be an example of production
quality code but to illustrate what the authors are saying about
using realloc(). The code is knowingly simplified to do that. The
paper points out this simplification later on, in point 1 of the
"Drills" section: "Figure 1's stack sacrifices speed for clarity
and brevity", along with a reference to Kernighan and Pike's book
"The Practice of Programming". I suspect lots of people react to
the paper mainly on the basis of their impression of this code,
without understanding why the code is there or what it is meant to
illustrate.