🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #274

Re: Taming The Switch-Statement

#274
From: Dan Cross
Date: Mon, 12 Oct 2026 17:34
73 lines
4215 bytes
In article <11aidi3$3gbu4$1@dont-email.me>, bart  <bc@freeuk.com> wrote:
>On 12/10/2026 06:22, David Brown wrote:
>> On 12/10/2026 00:05, bart wrote:
>
>>> So you don't really get it. That's fine.
>>>
>> 
>> So now you can drop it, along with all your other complaints about the C 
>> language and tools people use with it?
>
>My opinions haven't changed at all. KT doesn't care because he doesn't 
>understand the importance of having properly designed features. Probably 
>he hasn't been involved in having to process somebody else's source code 
>or having to translate it or port it.

I think you're free to criticize the language, if you like.  But
you are not free to assign to others opinions that they may not
hold; at least if you intend to be taken seriously.

I kinda sorta agree that requiring `break` between `case`
statements in C was an historical mistake, but here we are: it
is 2026, and the language has done that for more than 50 years
now.  The ship for changing it has sailed.  What is one left to
do, besides acknowledging it as a wart on the face of the
langauge?

Everyone here knows that C is imperfect; everyone knows that if
one were starting from scratch now, given the hindsight of 50+
years, one would do things differently.  So what?  We're not
starting from scratch, the language we have is the language that
we have, and there are real-world complexities that make it
difficult (at best!) to change.  Simply put, no one is
suggesting that C is perfect, but people are saying that one can
live with it.

I don't read Keith trying to defend C here so much as simply
explain what it does, and how one works around the complaints
about it that you identify.

>I have an old tool which /visualises/ C source code by trying to express 
>it in my syntax. It is not a formal transpiler: the semantics are not 
>translated, just the shape of the code.
>
>Still, the transformation is usually startlingly clear compared with the 
>original. Anyway I applied it to two examples, first:
>
>[snip]

So what?  What do you think that that shows?  That your language
doesn't have `break`?  Ok, but you already knew that, right?  We
have it on your authority that it is true, so we know that, too.
But why does it matter?

I find such arguments strange, as they're not really arguing
anything meaningful.  It's like Anton Ertl's complaint about
Rust vis binary search trees in `comp.arch`: because he did
not write his tree implementation using completely safe Rust
_the same way he did in C_, then somehow Rust is deficient; but
Rust is a different programming language, with different
semantics and different constraints about how objects may be
referred to, etc.  That the structure of a program in two
different programming languages with different semantics is
different seems axiomatic, and frankly doesn't say much about
the language.  So it is here, as well.

You can fairly say, "I don't like this" about something in C;
that's fine.  Others may even agree with you.  But C is what it
is, and unless you're willing to engage with the committee and
larger language community to change it (which is going to be
very, very hard; buckle up) then that is all that it will be.

	- Dan C.
Technical Details
Message-ID: <11aj5nt$t7t$1@reader2.panix.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
References: <119qf6l$2rmg3$1@dont-email.me> <11ah16h$320sj$2@dont-email.me> <11ahqpu$38ir0$3@dont-email.me> <11aidi3$3gbu4$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!panix!.POSTED.spitfire.i.gajendra.net!not-for-mail
From: cross@spitfire.i.gajendra.net (Dan Cross)
Newsgroups: comp.lang.c
Subject: Re: Taming The Switch-Statement
Date: Mon, 12 Oct 2026 17:34:53 -0000 (UTC)
Organization: PANIX Public Access Internet and UNIX, NYC
Message-ID: <11aj5nt$t7t$1@reader2.panix.com>
References: <119qf6l$2rmg3$1@dont-email.me> <11ah16h$320sj$2@dont-email.me> <11ahqpu$38ir0$3@dont-email.me> <11aidi3$3gbu4$1@dont-email.me>
Injection-Date: Mon, 12 Oct 2026 17:34:53 -0000 (UTC)
Injection-Info: reader2.panix.com; posting-host="spitfire.i.gajendra.net:166.84.136.80";
	logging-data="29949"; mail-complaints-to="abuse@panix.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: cross@spitfire.i.gajendra.net (Dan Cross)