🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #279

Re: Taming The Switch-Statement

#279
From: Scott Lurndal
Date: Mon, 12 Oct 2026 18:46
24 lines
2017 bytes
cross@spitfire.i.gajendra.net (Dan Cross) writes:
>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:
>>

>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?

I, on the other hand, don't consider it a mistake, in the
context of the C and C++ languages.   I've used the ability to
fall through in a significant fraction (50% in some applications) of
the switch statements that I've written over the last
five decades of C  and C++programming.

Absent other changes to the syntax (e.g. non-contiguous ranges
in the case selector[*]) the requirement to use break to avoid
falling through to other cases is rather valuable to me.

[*] I also use the gcc extension supporting contiguous ranges heavily.
Technical Details
Message-ID: <5W9zS.161421$98z8.84067@fx33.iad>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx33.iad.POSTED!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> <11aj5nt$t7t$1@reader2.panix.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer01.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx33.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: scott@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: Taming The Switch-Statement
Newsgroups: comp.lang.c
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> <11aj5nt$t7t$1@reader2.panix.com>
Lines: 24
Message-ID: <5W9zS.161421$98z8.84067@fx33.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Mon, 12 Oct 2026 18:46:25 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Mon, 12 Oct 2026 18:46:25 GMT
X-Received-Bytes: 1783