Article View: comp.lang.c
Article #473Re: Taming The Switch-Statement
From: bart
Date: Sat, 17 Oct 2026 17:23
Date: Sat, 17 Oct 2026 17:23
60 lines
4228 bytes
4228 bytes
On 17/10/2026 17:39, Michael S wrote:
> On Fri, 16 Oct 2026 15:00:27 -0700
> Keith Thompson <Keith.S.Thompson+u@gmail.com> wrote:
>
>> Tim Rentsch <tr.17687@z991.linuxsc.com> writes:
>>> 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.
>>
>> Unquestionably? Why?
>>
>
> I don't know why Tim prefers it.
> I prefer it (strongly) because it is different from regular label. So
> reader that wants to understand a flow of the program should not be
> concerned with possibility of jumping to it from places outside for().
>
>> I do like the fact that it doesn't conflate goto labels with loop
>> names, but I still prefer the "NAME: for (;;)" form, partly because
>> it's consistent with several other languages.
>>
>
> You mentioned itself that in Ada loop labels are distinct from regular
> labels. I would think that Ada alone easily outweighs "several other
> languages" if we compare by number (and likely by quality) of man-hours
> invested into thinking and discussion of syntactic features.
> Anyway I value appeal to success more than appeal to authority so by my
> own standards the argument above is weak.
I was around when Ada was being developed and refined, a process that
took years.
By contrast, C looks like it was just thrown together with little
thought, and probably that is exactly what happened.
In the end, Ada was a language that you could admire, but you'd rather
other people used. It's a solid language but I found it too formal and
rather dull (not that it was available for me to use).
Still, I borrowed some syntactic features from it.
One interesting fact that people might forget is that it was
case-insensitive, a welcome difference IMV.
Technical Details
Message-ID:
<11b0av3$edsd$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> <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> <11au6pr$3mdne$1@kst.eternal-september.org> <20261017193908.00000106@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: bart <bc@freeuk.com> Newsgroups: comp.lang.c Subject: Re: Taming The Switch-Statement Date: Sat, 17 Oct 2026 18:23:47 +0100 Organization: A noiseless patient Spider Lines: 60 Message-ID: <11b0av3$edsd$1@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> <11au6pr$3mdne$1@kst.eternal-september.org> <20261017193908.00000106@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 17 Oct 2026 17:23:50 +0000 (UTC) Injection-Info: dont-email.me; logging-data="472973"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Cl6zskM+xQnF/hs2p3pEg"; posting-host="f42af6156aabd93e2f9ced57c648ec1a" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:ONlElHWAvaGOt1Ww1pL+UKttEv8= sha256:jJAkGEK3hYuiwZJST3fK9ufMG4KFy8VuOjgTo2REm9M= sha1:ddwn5iYhLhjubQ+zps+jf5uxiM4= sha256:fvk3LlVv0P/HcdvdBggr65pC9pchnGC6pd8EgOzJLWA= In-Reply-To: <20261017193908.00000106@yahoo.com> Content-Language: en-GB