🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #125

Re: Taming The Switch-Statement

#125
From: Janis Papanagnou
Date: Sat, 10 Oct 2026 19:55
24 lines
2571 bytes
On 2026-10-10 21:02, Michael S wrote:
> On Sat, 10 Oct 2026 20:08:20 +0200
> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
> 
>> Yes. - And while "C" has 'goto' as well it also supports 'break' for
>> some purposes; e.g. as a loop-exit, so it makes sense to reuse that
>> keyword for other purposes as in 'switch' where it's been useful.
> 
> After practicing C programming for more than 35 years I am deeply
> convinced that reuse of the same 'break' keyword for loops and for
> switch was a mistake. [...]

Well, I think the principal design criticism that bart made had a
stronger impact on the "C" language design than the profane re-use
of the 'break' keyword. My impression is that most languages try to
minimize the amount of keywords. (The extreme scarcity of keywords
in "C" and the syntactical consequences is actually something I
rather don't really like with C-like languages.)

But I got curious about what your concrete reasons for that deeply
conviction are; in which way was it a "mistake"?

Janis
Technical Details
Message-ID: <11ae56o$cjlv$4@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> <11ad9fg$cjm0$4@dont-email.me> <11addhr$1oakb$1@dont-email.me> <11aduuk$cjlv$1@dont-email.me> <20261010220212.000063fd@yahoo.com>

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: Janis Papanagnou <janis_papanagnou+ng@hotmail.com>
Newsgroups: comp.lang.c
Subject: Re: Taming The Switch-Statement
Date: Sat, 10 Oct 2026 21:55:04 +0200
Organization: A noiseless patient Spider
Lines: 24
Message-ID: <11ae56o$cjlv$4@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> <11ad9fg$cjm0$4@dont-email.me>
 <11addhr$1oakb$1@dont-email.me> <11aduuk$cjlv$1@dont-email.me>
 <20261010220212.000063fd@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 10 Oct 2026 19:55:05 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="413375"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX18D/MZkKmfqD2xTk9C5vEQO"; posting-host="51a9598490edb80150aa60ca9e0cee6b"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:dHPEr9rBCg/Bbx6fnShP1S7897E= sha256:+P7OfMCy5q9a+I0O5WwHQ7ZSIeudJVTxfS7noJkF2Pg=
	sha1:aA58FHAu9oTC+4SwKk2HS7+u4vM= sha256:ox9HFi0c4C+xEY8tIXjaV7PGGkf5JKL/j21u9zojM3I=
Content-Language: en-US
In-Reply-To: <20261010220212.000063fd@yahoo.com>