Article View: comp.lang.c
Article #497Re: Taming The Switch-Statement
From: David Brown
Date: Sun, 18 Oct 2026 12:18
Date: Sun, 18 Oct 2026 12:18
34 lines
3300 bytes
3300 bytes
On 16/10/2026 23:22, Tim Rentsch wrote:
> Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
>
>> I find "break NAME;", where "NAME" is the name of an enclosing
>> construct, unambiguously better than "break N;", where N is the
>> number of levels to break out of. [...]
>
> Definitely.
>
>> There's a proposal for C2y to use goto labels as loop names, and a
>> competing one to define a new syntax like "for NAME (;;)" :
>>
>> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3355.htm
>> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3377.pdf
>
> I'm not particularly a fan of multi-level break/continue. But if
> we're going to have one of these, the second ("for NAME (;;)") is
> unquestionably better.
Given the number of questions asked, the various proposals for labelled
break and continue in both C and C++, and the fact that the C standards
committee have already chosen "name: for (...)" as their syntax, you are
unquestionably wrong to say that the second form is "unquestionably
better". Indeed, you would also have been wrong had you said the first
form is "unquestionably better".
You can have your opinion, and you can have justification for that
opinion, but it is not fact, and it is not unquestionable. There are
pros and cons of both variants, and different people will put different
weightings on which of those are most important to them personally - or
which they think will be most important for the language and programmer
community in general.
Technical Details
Message-ID:
<11b2de0$141vj$2@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> <11ad9fg$cjm0$4@dont-email.me> <11addhr$1oakb$1@dont-email.me> <11aduuk$cjlv$1@dont-email.me> <20261010220212.000063fd@yahoo.com> <11ae56o$cjlv$4@dont-email.me> <20261010230355.00005189@yahoo.com> <11ae7eb$cjlv$6@dont-email.me> <11aeee0$24k8m$1@kst.eternal-september.org> <11aer17$286ml$2@dont-email.me> <11aeusp$29hmu$2@kst.eternal-september.org> <86mrsdpcgp.fsf@linuxsc.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: David Brown <david.brown@hesbynett.no> Newsgroups: comp.lang.c Subject: Re: Taming The Switch-Statement Date: Sun, 18 Oct 2026 14:18:08 +0200 Organization: A noiseless patient Spider Lines: 34 Message-ID: <11b2de0$141vj$2@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> <11ae56o$cjlv$4@dont-email.me> <20261010230355.00005189@yahoo.com> <11ae7eb$cjlv$6@dont-email.me> <11aeee0$24k8m$1@kst.eternal-september.org> <11aer17$286ml$2@dont-email.me> <11aeusp$29hmu$2@kst.eternal-september.org> <86mrsdpcgp.fsf@linuxsc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 18 Oct 2026 12:18:09 +0000 (UTC) Injection-Info: dont-email.me; logging-data="1181683"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HDJ2aP2cvqXYvmtXUNTKw9gnp2s6a4ZU="; posting-host="a272f2752d0a4376a695806f42b83d2a" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:aKB6/HK8D7gQ8/ONgLf3Ji8l7qI= sha256:8+uVgA5X4IDlWxQaUAulfIcAHqi99h3SJiiAAkaGKDE= sha1:SvN18P8qACvpqtQ5gUtmq8OJYL4= sha256:SK/Kd2Va2oSe43WvWeIAPpFINP+WFBc/2RR0sW41A2Q= Content-Language: en-GB In-Reply-To: <86mrsdpcgp.fsf@linuxsc.com>