Article View: comp.lang.c
Article #258Re: Taming The Switch-Statement
From: David Brown
Date: Mon, 12 Oct 2026 05:22
Date: Mon, 12 Oct 2026 05:22
68 lines
4518 bytes
4518 bytes
On 12/10/2026 00:05, bart wrote: > 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! There are /no/ programming languages that are successful, but not "quirky and flawed" - though there will always be differing opinions on what aspects are "quirky", and what aspects are "flawed". As long as there is more than one person involved, writing code in more than one way for more than one task, this is inevitable. The conflicts you have with people here do not stem from the quirks or flaws that you see in the C language. They stem from your totally unjustified belief that others do not see C as quirky and flawed - your arrogant and megalomanic belief that you alone see its quirks and flaws, and that you alone can "fix" them. The rest of us know that C is a very successful language, and can use it to write good and useful code. Some people here write in C because they like the language, some because it is the only language they can use (for one of many possible reasons). I have never met a C programmer who does not think the language would have been better with certain changes - but I have never met a programmer of /any/ language who does not have ideas about how the language could have been better for their use. > >> 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. > So now you can drop it, along with all your other complaints about the C language and tools people use with it? Alternatively, you are free to write proposals for the C standards committee, or take part in their discussions, aiming to actually change the things you so passionately insist need fixing.
Technical Details
Message-ID:
<11ahqpu$38ir0$3@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-mailReferences:
<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> <11ah16h$320sj$2@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!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail From: David Brown <david.brown@hesbynett.no> Newsgroups: comp.lang.c Subject: Re: Taming The Switch-Statement Date: Mon, 12 Oct 2026 07:22:06 +0200 Organization: A noiseless patient Spider Lines: 68 Message-ID: <11ahqpu$38ir0$3@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> <11ah16h$320sj$2@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Mon, 12 Oct 2026 05:22:06 +0000 (UTC) Injection-Info: dont-email.me; logging-data="3427168"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18URhH1mgxd9wSb2zIfJLJhxXhCdWo8U6E="; posting-host="711f10de653bed0662d2460037681553" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:1zwQE9r7FLsXkqiGsRhrqNSAEic= sha256:9Q29j0XlaRYt0qx5oU73C78DuEtHlL/816Z67ukvZio= sha1:+Jr1geGoaPPX2+NB0SnetLnt5W8= sha256:+EkI80mVxPyKFtRJKFfZW4Yd8vM4k+fxSImMyprbpRw= Content-Language: en-GB, nb-NO In-Reply-To: <11ah16h$320sj$2@dont-email.me>