🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #309

Re: Taming The Switch-Statement

#309
From: bart
Date: Tue, 13 Oct 2026 00:53
37 lines
2723 bytes
On 13/10/2026 01:02, Keith Thompson wrote:
> bart <bc@freeuk.com> writes:
> [...]

> Tell me, have this ever been a problem for you personally?

It's the bigger picture that is more the problem. And yes it has 
affected me as I've never been able to adopt C as my main language. I 
guess I was too spoilt.

But it isn't really about me - decisions in the language, how tools work 
and so on affect everyone.

And yes, discussing PL design is interesting to me - there's so much 
going on here!

>  Have
> you ever written a switch statement nested in a loop and wanted to
> break out of the loop from within the switch?  (In C; I'm not asking
> about your experience with other langauges.)  How much difficulty
> has it really cause for you?

Yes. I had to use 'goto'. I don't mind using goto when necessary but 
here it shouldn't have been.


>> * And also with 'case' only doing one label at a time, instead of
>>    being able to do, for example: 'case a, b, c:' or 'case x...y',
>>    although some of this is taken care of via extensions.
> 
> "case a, b, c:" is written as "case a: case b: case c:".  It's a little
> more verbose than it needs to be.  It's very mildly annoying.

It is quite annoying and a distraction. A lot more to mistype too.


Technical Details
Message-ID: <11ajvf2$492m$1@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> <11agils$2s3tg$1@dont-email.me> <11ahpqi$38ir0$2@dont-email.me> <11ainqf$3kkvd$1@dont-email.me> <11aj73v$c2u$1@reader2.panix.com> <11ajcv8$3u33s$1@dont-email.me> <11ajsfi$28f2$5@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: Tue, 13 Oct 2026 01:53:54 +0100
Organization: A noiseless patient Spider
Lines: 37
Message-ID: <11ajvf2$492m$1@dont-email.me>
References: <119qf6l$2rmg3$1@dont-email.me> <11agils$2s3tg$1@dont-email.me>
 <11ahpqi$38ir0$2@dont-email.me> <11ainqf$3kkvd$1@dont-email.me>
 <11aj73v$c2u$1@reader2.panix.com> <11ajcv8$3u33s$1@dont-email.me>
 <11ajsfi$28f2$5@kst.eternal-september.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 13 Oct 2026 00:53:54 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="140374"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/rMNxmgwqy9PfElPazHfEt"; posting-host="a4fe58cca8661e75894507eaca96fb60"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:ugl51ESJ5rouF5FDCqXuZaZ89m0= sha256:i2ZsbnrevgnzQ+QtcJyFCVrIYaQM5596WH7dbQ1vZBU=
	sha1:pvSRAE4ZNZJwfnT2jgaABGN2VMY= sha256:cVYPu9DPhroZXPGdGQGOCZz9+fyBwE3S0ocsfIpvyJU=
Content-Language: en-GB
In-Reply-To: <11ajsfi$28f2$5@kst.eternal-september.org>