Can Novices Jump Directly in C? (Books)
Erik Naggum
enag at ifi.uio.no
Fri Feb 8 12:16:21 AEST 1991
In article <1991Feb6.121722.1 at hulaw1.harvard.edu>, James Peregrino writes:
> Can anyone recommend an introduction to programming book that
> uses C? I'm not referring to C-For-Pascal-Programmers etc. kind of
> books. I'm aware that most introduction to programming books use
> Pascal, Basic, or Scheme as their language, but I haven't seen
> anybooks that start a novice out directly with C.
> The purpose of this is to help someone I know who intends to
> teach an introduction to programming class in C (it was formerly
> taught in Pascal).
<opinion>
C is not well suited for first time programmers due to its intimacy
with the hardware. It's better to learn some assembly language and
then "discover" the power of C by a little induction than to be given
the crypticity of C to handle in addition to learning what a loop is
good for.
C is not well suited for first time programmers also for the simple
reason that it has far too many ways of doing the same thing, which
can be horribly confusing to future programmers. Macros can be very
useful for experienced programmers, but they easily "clutter" programs
in the eyes and minds of the very young. Redefining part of the
language you're learning with a macro has to be deferred to people who
miss the opportunity to relieve themselves of some tedium. (Of
course, object-like macros (like #define MAXSTRLEN 81) are very useful
for ("manifest") constants.)
Now, as for Pascal, it's been hailed as such a good introductory
language. Bogus! Pascal destroys the mind of hopeful young
programmers, and it takes years to un-learn Pascalisms. The same is
true, IMHO, of most ALGOL-based languages. Strong typing can be
useful if it is not a barrier. Ada has strong typing and has
overloading, so does C++. Simula has strong typing but sorely lacks
overloading and makes people dependent on "crutches". (I don't think
any of these languages are any good for beginners, either.)
I know, this doesn't leave much for the introduction-level programmer.
When kids begin to learn the alphabet and the language they speak in,
they read vastly more than they write. Programmers are encouraged to
write a snippet of code as soon as possible. (This is great if you
already have something useful to write, but we're not there, yet.) I
believe beginner programmers should be given some time to intuit the
meaning and expressiveness of good code, handling simple problems, and
then go on to read of more elaborate algorithms, still avoiding hairy
code and syntax. Programming is not only writing code, but also to
write in a way which you can understand and be proud of a week later,
and which has a high likelihood of containing only syntactic errors.
(Strong typing can be an aid in this respect -- but too much of it,
and young programmers get frustrated. Better that they learn to
behave themselves than to be forbidden to misbehave.)
All of this makes C a difficult language to handle, mainly because of
the amount of "new things" to remember, and the multitude of ways of
expression. I don't have any experience in teaching "fake languages",
but I imagine they'd have to capture the abstractions in programming
languages much better than real languages to be of value. Perhaps
this is why LISP (Scheme) is such a successful beginner's language?
The great thing about LISP is that it's very much a real language,
too.
Soi-disant fourth-generation languages are the worst things to ever
put before the mind of a young programmer, in my mind. Not only do
they have a very limited appreciation of the past 30 years of language
research, they also limit the field of applicaton to a horrible
degree.
Maybe I'm too "abstract" for the new programmers, but I've seen so
many bright minds be crippled by Pascal that I don't wish to let
people experience quite such a bad start.
To sum this up, I think, if you let beginners _read_ code, explaining
how things work, what kind of syntaxes (grammars) are used, that is,
make it much more of a linguistic approach than "algorithms and data
structures", they won't be the archetypical "beginners" for more than
the first month or so. Ask them to do obviously stupid things on the
computer as their first move, and they may remain beginners for years.
</opinion>
Whatever you do, avoid all books by Herbert Schildt. The poor
students will be even more crippled than they would have been with
Pascal. Schildt is an author who truly believes the reader is a
near-complete idiot, and he also sincerely believes that his book is
not going to help him, being as inane in the last as in the first
chapter.
Yes, I think it's too easy to start off on the wrong track for our
future programmers. The MS/PC-DOS world isn't helping them, either.
Au contraire! the vast majority of products in this world expect a
user with an alarmingly low intelligence and learning ability. My
experience is that young programmers are like kids on their first day
of school -- eager to learn and so easily frustrated by bad teachers.
Except, of course, that programmers are generally more curious and
more willing to learn, and dare I say more intelligent?, than most
kids -- and other apprentice craftsmen.
Aren't there some truly bright programmer who take apprentices and
teach them the craft, not trying to impress them with so many bogus
"tricks of the trade"? I know I would have spent a few years less in
"apprentice" state had there been anyone who could have showed me the
(right) way.
--
[Erik Naggum] <enag at ifi.uio.no>
Naggum Software, Oslo, Norway <erik at naggum.uu.no>
More information about the Comp.lang.c
mailing list