Newsgroups: comp.lang.lisp
From: cyber_surfer@wildcard.demon.co.uk (Cyber Surfer)
Path: cantaloupe.srv.cs.cmu.edu!nntp.club.cc.cmu.edu!godot.cc.duq.edu!news.duke.edu!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!news.sprintlink.net!pipex!demon!wildcard.demon.co.uk!cyber_surfer
Subject: Re: Why do people like C? (Was: Comparison: Beta - Lisp)
References: <LYNBECH.94Sep15223604@xenon.daimi.aau.dk> <os2Psc1w165w@sytex.com> <35dcf9$jao@news.aero.org> <35kbl8$8ni@relay.tor.hookup.net>
Organization: The Wildcard Killer Butterfly Breeding Ground
Reply-To: cyber_surfer@wildcard.demon.co.uk
X-Newsreader: Demon Internet Simple News v1.27
Lines: 109
Date: Tue, 20 Sep 1994 15:46:10 +0000
Message-ID: <780075970snz@wildcard.demon.co.uk>
Sender: usenet@demon.co.uk

In article <35kbl8$8ni@relay.tor.hookup.net>
           hutch@RedRock.com "Bob Hutchison" writes:

> pressure to develop software using Basic.  Basic handled memory for you,
> automatically, and for many situations not well enough.  Basic was also
> slow.  If you needed something faster you went to C or Pascal.  At the

Most Basics (well, the ones I've seen) were badly implemented, and
yet still given names like "Fast Basic". It seems that implementors
of Basic rarely read any books on compiler theory, not even PJ Brown's
Writing Interactive Compilers and Interpreters, which is a book that
might clear up a _lot_ of comfusion in the minds of programmers. If
only a few more of them would read it. <sigh>

A small number of programmers chose Forth, instead of Basic. Forth
has a much higher standard of compiler writing, but Forth is an odd
case. So is QuickBasic, which also uses threaded code. It also uses
a few techniques written about, or at least hinted at, in Brown's
book. It's still supplied by Microsoft with DOS, I think, but I don't
remember ever seeing any documentation for it. These days, Visual
Basic will have taken over, and I'm not so sure about the quality
of VB's implementation. That's another issue.

> time C was available for free (thanks UNIX and I think Dr. Dobbs), pascal
> was not (it was expensive).  Pascal was also usually pcode based and
> ran in proprietary environments.  Pascal also fell down badly when you
> needed control of your memory.  In other words, the available Pascal
> *implementations* were not different enough from Basic in a few key
> aspects.  C was used.  (Let me point out one other belief that will perhaps
> further illustrate the world at that time, it was the official position of
> a very large multi-national company that compilers were unreliable and
> produced poor code, and that this was *inherent* in the technology).

I used the P-system on a Z80 machine running at 1.76 Mhz, and it
run _very_ slowly. The code from a C compiler based on Small C
ran much faster. So, I can agree with you about that. However, the
compiler only just ran on that machine, and only by generating
assembly code.

My 2nd machine was a 68K running at 8 Mhz. It also ran the P-system,
but at a decent speed. I wasn't aware of it being much faster than
the code from a C compiler for the same machine. That's subjective,
and I never did do a proper comparison. In any case, it was too late,
as most people at that time were beginning to use micros made by
IBM, or clones of those machines. I've yet to use a Pascal compiler
for that platform.

I'm merely adding to your comments with my own experience. My own
belief is that ignorance of compiler theory is a big factor, both
with programmers and with the writers of many early compilers for
micros. This is one of those historical "accidents" that's hard to
correct. It's worth trying, tho. I often refer programmers to PJ
Brown's book, which is still being published. It's worth reading
even if you're not interested in compilers, simply for the Twelve
Deadly Sins of Programming. It's a book for all programmers.

> My real disagreement with your theory is that I don't think it is sufficient
> to explain why C is actually used.  Why does an experienced programmer
> use it?  In my case it is because of the history I described above.  C has

One reason could be that that's the job offered to them. I see ads
for C/C++ jobs all the time, and it's well known that not everyone
(ahem, a manager, for example) knows as much about the job as the
programmer who actually _does_ it.

I hear a lot about this from my friends in network support, except
that in their case, it applies to network software. I'm told that
when they ask why some people do things the way they do, the answer
is just that they've "always done it that way". When people like
that are in charge of networks with 1000+ machines, I start to worry.

Why should I worry less about managers of programmers? I hope
someone can diagree with me about this, as it may just be personal
experience, either mine or my friends. Please tell me if it is!

> How do you get an experience programmer to consider something other
> than C?  I've found it tremendously effective to (persistently) encourage
> programmers to try something serious in smalltalk.  So far I've had a
> 100% success rate in getting them to realise the limitations of C/C++.

I've succeeded in converting a friend from C to Actor, which is
Smalltalk-like language. This was before C++ became so popular.
The problem is, the friend isn't a professional programmer anymore.
He's moved to network support, where he writes batch files that
people claim are too complicated for them to understand, until
he asks them if they tried _reading_ the file. He dispairs.

> Smalltalk isn't magic, but it has a really nice bunch of tools that go
> with it.  The lisp environments would work just as well I think, but until
> recently they were too expensive.  (These guys all bought smalltalk
> with their own money -- I can be very persistent :-).

You might like to look at Dylan when the first system ships. I'm
hoping that it'll have a better chance than Smalltalk, which is
doing pretty good in some places, and getting fabulous reviews.
I won't suggest that it'll beat C++, but who knows? We can hope.

> Even shorter, C/C++ is being used for the same reasons COBOL is
> still used.  (an awfully long post to come to that conclusion, sorry :-)

So C/C++ will be around for a few decades after we all "know" that
it's dead? ;-) Don't worry about the length, as I think you made a
lot of good points, and they add support to your conclusion.

Martin Rodgers
-- 
Future generations are relying on us
It's a world we've made - Incubus	
We're living on a knife edge, looking for the ground -- Hawkwind
