🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #564

Re: Taming The Switch-Statement

#564
From: bart
Date: Mon, 19 Oct 2026 19:34
252 lines
11987 bytes
On 19/10/2026 18:22, Dan Cross wrote:
> In article <11b500f$216c4$1@dont-email.me>, bart  <bc@freeuk.com> wrote:
>> On 19/10/2026 02:19, Dan Cross wrote:
>>> I see that you convenient snipped out my comment about C++,
>>> which is the direct counter example.
>>
>> I don't want to discuss C++. That language is abominable, other than as
>> the go-to example of language design going very wrong.
> 
> Oh.  You don't _want_ to; I see.  So you want to make statements
> about the relative "productivity" of languages but ignore the
> most prominent counter example to your argument because you
> don't _want_ to discuss C++.
> 
>>> "Had" is a strong word; dare I say it...a subjective word.
>>>
>>> In fact, there have been all kinds of alternatives for years.
>>> In the earlish 1980s, there was Modula-2, PL/M, Forth, Ada, CLU,
>>> BLISS, and so on.  You yourself admit you started from Algol68.
>>> By the late 1980s you had Oberon, decent versions of ML, C++
>>> and Objective-C, etc; by the 1990s, there were more than you
>>> could shake a stick at.  Now?  Take your pick.
>>>
>>> You never "had" to use your own language.
>>
>> OK. But they HAD to create C?
> 
> Doesn't matter.  They did.  You weren't there; you don't know
> why they made the decisions they made, whether they gave this or
> that serious consideration and dismissed it, or were unaware of
> one thing or another, what constraints they were operating
> under, etc.
> 
> It is _so easy_ to sit here and throw stones at people toiling
> away in the 1960's because they made decisions you don't like.
> But, bluntly, you haven't put in the work to have an opinion:
> you are ignorant of the history, and actively resist even simple
> things like reading the standard to back up your assertions;
> when you're shown to be incorrect, you double down or (yes) move
> the goalposts by making some other statement.
> 
> You came up with your toy language and compiler in the 80s; more
> than a decade after C.  It's cute that you felt you _had_ to do
> that, but you were in a completely different context than the
> 1127 folks at Bell Labs who created C.
> 
>> There were quite a few languages in the
>> early 70s too: like Pascal, Fortran, PL/I, Coral-66, plus of course BCPL
>> and B. So why a new one?
> 
> B _was_ a new language.  Pascal as a useful language beyond
> pedagogy postdates C.  Pretty much the rest of this is discussed
> in DMR's C history paper, which I'm willing to bet you haven't
> bothered to read.
> 
>> Anyway you don't know my circumstances. My homemade machine had
>> absolutely ZERO software. I literally had to start from binary machine
>> code, as there was no keyboard at first (more below).
> 
> Next you'll tell us you went to the beach and picked up sand so
> you could smelt it and create your own silicon wafers, right?
> 
> You described its capabilities.  It was vastly more capable than
> a PDP-7, and it had only one user: you.
> 
>> I also never used Algol68; I'd only seen it in a book.
> 
> You said yourself you modeled your language on Algol68; whether
> you had used it or not is irrelevant.
> 
>> In my job later I was an engineer, not a programmer, and there was no
>> budget for software such as compilers. But they would anyway have been a
>> nightmare to install (floppy disk formats were not standard!), and would
>> been hopelessly slow to use.
>>
>> The language I ended up creating was perfect for my needs and compiled
>> more or less instantly.
> 
> You said you could not use a compiler and then literally
> described using a compiler.
> 
>>>> You do know; you just don't want to admit it. (Imagine introducing C
>>>> declarations into a current language.)
>>>
>>> No, really; C's declaration syntax was inspired by FORTRAN, and
>>> generations of scientists and engineers have managed that
>>> language just fine.
>>
>> FORTRAN syntax looked nothing like C! Unless you mean the general
>> pattern of 'INTEGER A, B' which was shared by half of all languages.
> 
> That was literally the thing you said you address with
> left-to-right syntax, and that anyone who proposed such would be
> laughed at.  Now it's fine, just not in C.  Because C is bad.
> Or something.
> 
>> (I spent a year writing FORTRAN on mainframes and minicomputers.)
> 
> I'm sure no one else here has done that.  (*rolls eyes*)
> 
>>>   Generations of programmers have handled C's
>>> all right as well.
>>
>> How many gave up because it was too much? How many still struggle with
>> it and have to employ those 4 or 5 workarounds which I mention
>> elsewhere? How much has it affected productivity?
>>
>> Your statement is meaningless. Maybe some task (in any sphere) takes 17
>> steps to achieve. People will manage. But then somebody figures out how
>> to do it in 3 steps; that's better right?
> 
> Maybe, maybe not.  There may well be other considerations that
> factor into that decision.
> 
>> No, according to you: let's stick with 17 steps; people have always
>> managed, and 10 million people can't be wrong!
> 
> So by this metric, it's cool if a pilot just jumps into an
> airliner, turns it on, and takes off?  The rest of the
> pre-flight checklist is just busywork, amirite?
> 
>>> Then why do you keep bringing your language up, showing snippets
>>> of its syntax, and so on?
>>
>> Suppose that language didn't exist. I guess then it would be OK to bring
>> up hypothetical new features and bits of syntax here? People do it all
>> the time (even Keith did today, of all people).
>>
>> But if those examples come from an actual, working and proven
>> implementation, which lend them more weight, then it is not allowed and
>> the examples then become irrelevant?
> 
> If you want to discuss C on its merits, then discuss C.
> Unfortunately for you that would probably mean you'd have to
> actually read the relevant documentation.
> 
> Do you _really_ think that the people who post here regularly
> are not aware that, say, other variable declaration syntaxes
> exist that are less messy than C's?  No, seriously, don't give
> me some other example from your language, answer that question
> honestly: do you _really_ believe that no one here understands
> that fact, or just outright disbelieves it?
> 
>> I guess it is not playing the game in that case?
>>>> Why hasn't there long been an alternative systems language that didn't
>>>> have C's crazy syntax and stupid quirks? I mean like 30-50 years ago.
>>>
>>> There...have been?  And still are?
>>
>> In that case, why has C itself been so heavily used, in OSes, drivers,
>> and endless libraries, rather than one those which you suggest I adopt?
> 
> I can think of any number of reasons: legacy, compatibility,
> tool availability, in some cases just personal preference.  For
> any one of these, I'm sure that someone has already told you
> sometime in the last six months.  My repeating them is unlikely
> to have any effect.
> 
>> I needed a language that worked at a lower level, could access hardware,
>> had inline assembly, had a weak type system that allowed all sorts of
>> underhand methods /to get things done/.
>> [snip same stuff over again]
> 
> No one cares.
> 
>> [snip]
>> I gave you my circumstances above. What would /you/ have done?
> 
> Probably not spent years seething about how the rest of the
> world is wrong for making decisions I would not have.
> 
>> [snip]
>>> That's why ABIs matter.
>>
>> You're confusing APIs and ABIs.
>>
>> ABIs are a matter for compilers. Translating APIs into a set of bindings
>> for another language is someone else's job.
> 
> You really don't understand how multilangauge environments work,
> do you?  Maybe have a look at an ABI document at some point.
> 
>> [snip sob story about walking uphill both ways in the snow]
>> But the crude
>> language I created FROM NOTHING still looked like this:
>>
>>     int a, b, c
>>     println a + b
> 
> Ok.  Don't really care.
> 
>>> As mentioned, C came from B, once they got a PDP-11; it was an
>>> incremental evolution of a language they already had.  The type
>>> syntax you find so distasteful was inspired by FORTRAN.
>>
>> Please give an example of FORTRAN that looks like C.
> 
> Why?  What would that show?
> 
> If you'd get over yourself for ten minutes and read the HOPL
> paper on C, you may see this:
> 
> |Fortran influenced the syntax of declarations: B declarations
> |begin with a specifier like `auto` or `static`, followed by a
> |list of names, and C not only followed this style but
> |ornamented it by placing its type keywords at the start of
> |declarations.
> (https://www.nokia.com/bell-labs/about/dennis-m-ritchie/chist.html)
> 
>>> It's so weird to me that you make such absolute pronouncements
>>> about C and the choices that into its design, but are so
>>> ajbectly ignorant of the actual history.  Bluntly, you just are
>>> not very well informed about it to make cogent comments.
>>
>> How does knowing the history in such detail help? If a feature stinks,
>> it stinks.
> 
> Much of your ranting amounts to, "how could anyone have possibly
> thought this was a good idea?"  Perhaps if you looked into the
> history a bit, you may become enlightened as to why anybody
> possibly thought it was a good idea.
> 
>> See my post yesterday about the impact choosing a prefix dereference op
>> instead of postfix made on the language. It was probably even more
>> far-reaching than stated.
>>
>> And yet Pascal was right there!
> 
> Amazingly, ALGOL W used syntax much closer to C's, despite being
> the immediate predecessor of Pascal.
> 
>> That choice had nothing to with limited hardware; it was just the wrong one.
> 
> One final quote from HOPL:
> |Although we entertained occasional thoughts about implementing
> |one of the major languages of the time like Fortran, PL/I, or
> |Algol 68, such a project seemed hopelessly large for our
> |resources: much simpler and smaller tools were called for.  All
> |these languages influenced our work, but it was more fun to do
> |things on our own.
> 
> So, they were aware of all the languages you've cited as
> influences.  And yet they decided to do things differently.
> 
> Perhaps they had their reasons.  They are not (in the case of
> Ken) and were not (sadly, in the case of Dennis) idiiots or
> fools.
If you're going to shit over everything I say, ignore points and keep 
changing the subject, then OK you win, I lose.

Satisfied?
Technical Details
Message-ID: <11b5rce$2c5f4$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-mail
References: <119qf6l$2rmg3$1@dont-email.me> <11b0mfv$j5ll$1@dont-email.me> <11b3r71$6me$1@reader2.panix.com> <11b500f$216c4$1@dont-email.me> <11b5jl1$s7r$1@reader2.panix.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: Mon, 19 Oct 2026 20:34:37 +0100
Organization: A noiseless patient Spider
Lines: 252
Message-ID: <11b5rce$2c5f4$1@dont-email.me>
References: <119qf6l$2rmg3$1@dont-email.me> <11b0mfv$j5ll$1@dont-email.me>
 <11b3r71$6me$1@reader2.panix.com> <11b500f$216c4$1@dont-email.me>
 <11b5jl1$s7r$1@reader2.panix.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Mon, 19 Oct 2026 19:34:39 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2495972"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19VzZXM26GeBUfv9tXsvFPB"; posting-host="490a98fc4950ca5dcdd86ea57e554712"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:rweiHaAWx4aTZojT3JjmIAJKdYA= sha256:+zj8YDAASujBoxRSjFNdsQ4K/dLQB2ezqVQLihy1Rgs=
	sha1:71Az6cxSKQOGsmfDeqwxcxz6xlk= sha256:OcpBApEKTJpZ9COGu/mU3LuQymA0Ip3b77fGoVWlvT4=
In-Reply-To: <11b5jl1$s7r$1@reader2.panix.com>
Content-Language: en-GB