🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #360

Re: Taming The Switch-Statement

#360
From: Lawrence D’Oliveiro
Date: Tue, 13 Oct 2026 21:54
12 lines
2199 bytes
On Tue, 13 Oct 2026 07:23:40 -0000 (UTC), Waldek Hebisch wrote:

> So what those counts indicate: majority of loops is simple, that is
> have no early exit. Vast majority of early exits is done via
> 'return'.

My experience in my own C code is quite the opposite. Lots of loops
have exits in the middle, leading me to use forms like “for (;;)”. I
also try to avoid putting “return” anywhere other than the end of a
function, to make it easier to see the flow of control.

*cough* Nassi-Shneiderman diagrams *cough*
Technical Details
Message-ID: <11am99u$ul56$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-mail
References: <119qf6l$2rmg3$1@dont-email.me> <20261010220212.000063fd@yahoo.com> <11ae56o$cjlv$4@dont-email.me> <20261010230355.00005189@yahoo.com> <864iesjx6e.fsf@linuxsc.com> <11afvqt$2kloc$1@dont-email.me> <11ag37o$2ln0a$1@dont-email.me> <11agbsh$2pbk7$1@dont-email.me> <11aggaq$2qqh9$1@dont-email.me> <11agils$2s3tg$1@dont-email.me> <11agv1t$30q22$2@kst.eternal-september.org> <20261012220256.00003d07@yahoo.com> <11ajb95$3t8jj$1@dont-email.me> <20261012223144.00000f95@yahoo.com> <11akm9q$29tpl$1@paganini.bofh.team>

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: Lawrence D’Oliveiro <ldo@nz.invalid>
Newsgroups: comp.lang.c
Subject: Re: Taming The Switch-Statement
Date: Tue, 13 Oct 2026 21:54:06 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 12
Message-ID: <11am99u$ul56$2@dont-email.me>
References: <119qf6l$2rmg3$1@dont-email.me>
	<20261010220212.000063fd@yahoo.com> <11ae56o$cjlv$4@dont-email.me>
	<20261010230355.00005189@yahoo.com> <864iesjx6e.fsf@linuxsc.com>
	<11afvqt$2kloc$1@dont-email.me> <11ag37o$2ln0a$1@dont-email.me>
	<11agbsh$2pbk7$1@dont-email.me> <11aggaq$2qqh9$1@dont-email.me>
	<11agils$2s3tg$1@dont-email.me> <11agv1t$30q22$2@kst.eternal-september.org>
	<20261012220256.00003d07@yahoo.com> <11ajb95$3t8jj$1@dont-email.me>
	<20261012223144.00000f95@yahoo.com> <11akm9q$29tpl$1@paganini.bofh.team>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 13 Oct 2026 21:54:07 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="1004710"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+xsSZuwGkn3O1yvzrG29uY"; posting-host="f50919a0ed08414b1012e34ff88483da"
User-Agent: Pan/0.165 (Kostiantynivka)
Cancel-Lock: sha1:lPREEVGkkQNxw1JhIydXmycwQiM= sha256:VUPJkr7qWCnB+b/APDRCVQzfMJD/2D8JpQF/7hoZfKA=
	sha1:wr9uISoyhza2A5hHe0pr4LP9zxI= sha256:fW/c5+WnyjJ0brlxhOyE1o4uvZgf9aEelZ6vEYHYzzs=