Article View: comp.lang.c
Article #280Re: Taming The Switch-Statement
From: bart
Date: Mon, 12 Oct 2026 18:52
Date: Mon, 12 Oct 2026 18:52
24 lines
2505 bytes
2505 bytes
On 12/10/2026 19:46, Scott Lurndal wrote: > 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. So 99% of programmers have to suffer needing to pointlessly write 'break' everywhere, rather than the 1% having to write 'fallthru'. Although it sounds like even you need fall-through less often than break.
Technical Details
Message-ID:
<11ajaa1$3ssqg$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-mailReferences:
<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> <5W9zS.161421$98z8.84067@fx33.iad>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: Mon, 12 Oct 2026 19:52:47 +0100 Organization: A noiseless patient Spider Lines: 24 Message-ID: <11ajaa1$3ssqg$1@dont-email.me> 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> <5W9zS.161421$98z8.84067@fx33.iad> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 12 Oct 2026 18:52:50 +0000 (UTC) Injection-Info: dont-email.me; logging-data="4092752"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+CPWUOmcNv8r3hk0cJJnUK"; posting-host="77c9fe16ce3505b18aae67dd9ba4b8ee" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:s1PTyUl6IOVWfIAYujTyIo1D6sI= sha256:T4ur58eQMzd/4ZV3LD/TTc3P16RWYEOsv1FnH0wDM+k= sha1:KjWFdm9lbjwANiB0aEE+erWNgfM= sha256:RlGNVNWIOyFC0TVMKdRwFa+W2q1Jv4BA2iZr3O63zVA= Content-Language: en-GB In-Reply-To: <5W9zS.161421$98z8.84067@fx33.iad>