🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #479

Re: Taming The Switch-Statement

#479
From: Michael S
Date: Sat, 17 Oct 2026 18:03
77 lines
4952 bytes
On Sat, 17 Oct 2026 18:23:47 +0100
bart <bc@freeuk.com> wrote:

> 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).
> 

I use Ada off-spring VHDL very regularly.
I prefer it over Verilog, but I do it due to semantics and mostly
despite [inherited from Ada] syntax.

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

I don't like case-insensitivity, except, may be, for keywords.
I don't like begin..end.
Most of all, I don't like nested procedures that have visibility of
local variables of the parent (That's related to Ada, not significant
in context of VHDL).
I suppose, I don't like most of the thing that you like about
programming languages.


Technical Details
Message-ID: <20261017210359.00003dff@yahoo.com>
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> <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> <11b0av3$edsd$1@dont-email.me>

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: Michael S <already5chosen@yahoo.com>
Newsgroups: comp.lang.c
Subject: Re: Taming The Switch-Statement
Date: Sat, 17 Oct 2026 21:03:59 +0300
Organization: A noiseless patient Spider
Lines: 77
Message-ID: <20261017210359.00003dff@yahoo.com>
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>
	<11b0av3$edsd$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 17 Oct 2026 18:04:07 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="381826"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+0sLhhTbHManhYxOHllJnCJjifaF2J9Sc="; posting-host="8a2717059b3cb9979a1bc36c42d7abf4"
Cancel-Lock: sha1:B7nEjcrRGRZu9OK1+LRJzUs2OqE= sha256:33Xcvmm7GHflbO2qXOa9OFFkPd3BcwXbjBuDKpkl5A4=
	sha1:UvdAsproQWB0NszIMFXfgtdNqTU= sha256:q9z4bc/W4ZvXYoxUdk5xm8mPM0cPCHPNVeLfLDs8UvU=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)