🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #243

Re: Taming The Switch-Statement

#243
From: bart
Date: Sun, 11 Oct 2026 22:05
36 lines
2879 bytes
On 11/10/2026 22:04, Keith Thompson wrote:
> bart <bc@freeuk.com> writes:
>> On 11/10/2026 03:55, Keith Thompson wrote:
>>> bart <bc@freeuk.com> writes:
>>>> On 11/10/2026 00:30, Keith Thompson wrote:
>>>>> bart <bc@freeuk.com> writes:
>>>>
>>>>> Huh?  "computed goto" is not a looping construct.
>>>>
>>>> You only hear about it in the context of interpreter dispatch loops.
>>
>>>>> Yes, of course it does.  Did you think that a construct that's used
>>>>> in most existing C programs could just be removed from the language?
>>>>
>>>> I didn't say they should be removed.
>>> So you want to add a new and less flexible looping construct on top
>>> of the existing one,
>>
>> So how would you do it: remove existing switch completely and replace
>> with the new version?
> 
> No, I'd leave it alone.
> 
> C's switch statement is, like C as a whole, "quirky, flawed, and
> an enormous success" (Dennis Ritchie said that).

Yeah, like anyone had a choice in the matter!

> You want to add a new construct that differs from switch only in
> that it doesn't have implicit fallthrough.  You think the existence
> of fallthrough behavior, or of any flexibility that you see as
> excessive, is a problem that needs to be fixed.  I don't.

So you don't really get it. That's fine.

Technical Details
Message-ID: <11ah16h$320sj$2@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <119qf6l$2rmg3$1@dont-email.me> <11ac0mi$19kfd$1@dont-email.me> <11ac2jv$1a84t$1@dont-email.me> <11ac783$1bkuo$1@kst.eternal-september.org> <11ad5eq$1l8hg$1@dont-email.me> <11aehqg$24k8m$3@kst.eternal-september.org> <11aenps$27sq7$1@dont-email.me> <11aetqv$29hmu$1@kst.eternal-september.org> <11afrfq$2j2o6$1@dont-email.me> <11agtkb$30q22$1@kst.eternal-september.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: Taming The Switch-Statement
Date: Sun, 11 Oct 2026 23:05:08 +0100
Organization: A noiseless patient Spider
Lines: 36
Message-ID: <11ah16h$320sj$2@dont-email.me>
References: <119qf6l$2rmg3$1@dont-email.me> <11ac0mi$19kfd$1@dont-email.me>
 <11ac2jv$1a84t$1@dont-email.me> <11ac783$1bkuo$1@kst.eternal-september.org>
 <11ad5eq$1l8hg$1@dont-email.me> <11aehqg$24k8m$3@kst.eternal-september.org>
 <11aenps$27sq7$1@dont-email.me> <11aetqv$29hmu$1@kst.eternal-september.org>
 <11afrfq$2j2o6$1@dont-email.me> <11agtkb$30q22$1@kst.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 11 Oct 2026 22:05:06 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="3212179"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+RAmmB5kgCxS0MdxOhXpxB"; posting-host="bb4c63ed27c528dcfc498e66a186f254"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Uep3FuK1ZH/BM5smaoArZXgN/o4= sha256:kwLUCfrdNfiy8zDjIBJhBoQRMN0CHqKmiVRz6s6jvj8=
	sha1:1BAvYJjmojYVuyfUg6mFmuClQUI= sha256:ILzuinEhGkk/Ma8nvpLGrQTCZK4ou5ozmJlaZRr3Dj0=
In-Reply-To: <11agtkb$30q22$1@kst.eternal-september.org>
Content-Language: en-GB