[comp.misc] Can Novices Jump Directly in C?

peregrin@hulaw1.harvard.edu (02/07/91)

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

I'll post the summary if people will send me e-mail.
Thanks,
James
+----------------------------------------------------------------------------+
+ James Peregrino                        |     JPEREGRINO@HBSSTG.HARVARD.EDU +
+ Programmer/Analyst                     |         PEREGRIN@STIG.HARVARD.EDU +
+ Science & Technology Interest Group    |    JPEREGRINO@HBS.HBS.HARVARD.EDU + 
+ Harvard Business School                |       PEREGRIN@HULAW1.BITNET      +
+ Boston, MA 02163                       +-----------------------------------+
+ Voice: (617)495-6307                   | My opinions are only my own and   +
+ FAX:   (617)495-0351                   | never H.B.S's.                    +
+----------------------------------------------------------------------------+
	

enag@ifi.uio.no (Erik Naggum) (02/08/91)

In article <1991Feb6.121722.1@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@ifi.uio.no>
Naggum Software, Oslo, Norway			   <erik@naggum.uu.no>

scm3775@tamsun.tamu.edu (Sean Malloy) (02/08/91)

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

I'm afraid that I have to agree with the above gentleman; C is not
generally good for first-time students unless they have a basic
knowledge of the hardware underneath.  I assume that you're wanting to
use (probably) Turbo C on PC's.  Check out _C Through Design_ by
Defenbaugh & Smedley.  It's being used for an introductory-level
class in C here at Texas A&M (Though prior programming experience is
reccommended for these students, this seems to be laziness on the
part of the instructor, and not a shortcoming in the book).  For
hardware background, I'd suggest _Peter Norton's Programmer's
Guide to the IBM PC/PS2_  (at least excerpts - students should
be familiar with what's available in the BIOS before jumping into
some of the more advanced features of C; it makes life easier, and
it makes students realize that there's more than one way to do things)

-Sean

py198723@academ01.mty.itesm.mx (Jesus Eugenio Sanchez) (02/10/91)

peregrin@hulaw1.harvard.edu 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 problem with the approach you're trying to do is that C is
definitely *not* a language for novice programmers. You have to know all
about functions, data structures, and all that parafernalia. So, perhaps
you have no choice: first learn Pascal, and then C. Not the other way
around.

				Eugenio Sanchez
				py198723@academ01.mty.itesm.mx

ekalenda@cup.portal.com (Edward John Kalenda) (02/12/91)

peregrin@hulaw1.harvard.edu 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.

I must differ with all the other postings about C being a poor language
for the first time programmer to learn. It is a complicated language,
IF you dump all the features on the student at once. I have successfully
taught several people with NO programming experience the C language. The
trick is to convince them the computer will not do what you want it to do,
only what you tell it, and you must tell it in GREAT detail.

Most of the time I only use the K&R white book and the runtime reference
manual that goes with the compiler in use. "Learning to Program in C" by
Thomas Plum (Plum Hall, Inc.  ISBN 0-911537-00-7) is not bad.

Teach them the basic constructs, add structures about 2/3 through the class,
spend the last two weeks discussing the power features like pointer
arithmatic (sp?), passing addresses of scalers to functions, hardware
details like short/int/long relative sizes, unions, typedefs, pre-processor
macros, and mixed language programming. They can always get into the stuff
that will confuse them in an intermediate C class.

Ed
ekalenda@cup.portal.com

marwk@levels.sait.edu.au (02/13/91)

In article <39182@cup.portal.com>, ekalenda@cup.portal.com (Edward John Kalenda) writes:
> peregrin@hulaw1.harvard.edu 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.
>
> I must differ with all the other postings about C being a poor language
> for the first time programmer to learn. It is a complicated language,
> IF you dump all the features on the student at once. I have successfully
> taught several people with NO programming experience the C language. The
> trick is to convince them the computer will not do what you want it to do,
> only what you tell it, and you must tell it in GREAT detail.
>
> Most of the time I only use the K&R white book and the runtime reference
> manual that goes with the compiler in use. "Learning to Program in C" by
> Thomas Plum (Plum Hall, Inc.  ISBN 0-911537-00-7) is not bad.
>
> Teach them the basic constructs, add structures about 2/3 through the class,
> spend the last two weeks discussing the power features like pointer
> arithmatic (sp?), passing addresses of scalers to functions, hardware
> details like short/int/long relative sizes, unions, typedefs, pre-processor
> macros, and mixed language programming. They can always get into the stuff
> that will confuse them in an intermediate C class.
>
> Ed
> ekalenda@cup.portal.com

K&R has got to be the worst book for learning C for a beginner that I have
seen!  I used it to advance my knowledge, but it gave me headaches years ago
when I wanted to learn the language.

The book by KELLY and POHL: TUBO C: The Essentials of C programming
is one of the best I have ever seen (for the beginner).

Its method of explaining programs by dissection is excellent - voluminous
details for each line a program.

The problems in each chapter are nice and easy adn complement the chapters
extremely well.

There is no need to use TURBO C as there is very little that pertains to
it specifically.  I believe there is also a product-nonspecific book
available too.

Ray
--
University of South Australia   | Plus ca change, plus c'est la meme chose.
P.O. Box 1                      | Ghing thien me how, ming thien gung me how.
Ingle Farm                      | Knobs, knobs everywhere,
South Australia                 |              just vary a knob to think!

pete@minster.york.ac.uk (02/14/91)

peregrin@hulaw1.harvard.edu 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.

Although it's not a _complete_ beginner's book one of the best intros
to C must be Kelley & Pohl's ``C By Dissection'' (Benjamin-Cummings, 86
or 87). It explains everything the novice needs to know to get going on
a Unix C environment (dunno if there are other machine-specific
versions) in a detailed and clear fashion. I bought it years ago solely
because because I couldn't find a copy of K&R, or Kelley & Pohl's ``A
Book On C'', but I've since recommended it to several people who wanted
to learn C. It's less advanced than either of these - but pretty good
for novices and not too bad for experienced programmers moving over to
C for the first time.

(besides, if your novices get enthusiastic you can always point them at
something more useful like Harbison & Steele -- or, preferably,
Stroustrup :-))

	Pete Fenelon
--
Pete Fenelon		 |JANET:   pete@uk.ac.york.minster
Dept. of Computer Science|Internet:pete@minster.york.ac.uk
University of York	 |UUCP:    {the world}!ukc!minster!pete 
York Y01 5DD ENGLAND	 |others:  pete%minster.york.ac.uk@nsfnet-relay.ac.uk
Tel: +44 904 432714      |Beer of the week:Mitchell's Single Malt Winter Warmer

mike (02/14/91)

In an article, levels.sait.edu.au!marwk writes:
>K&R has got to be the worst book for learning C for a beginner that I have
>seen!  I used it to advance my knowledge, but it gave me headaches years ago
>when I wanted to learn the language.

I personally found it to be an _excellent_ book when learning C.  One of
the things that I greatly dislike in many of the C books that are out today
is the focus on cute pictures and sayings (here is a how a structure is
declared, see the cute little elf holding up the structure in the diagram ...)

As it is said, C is not a big language, and is not served well by "big"
books that cram page after page of diagrams, flowcharts, etc. etc. ad nauseum.
The best companion is K&P's (as in "Pike") "Software Tools".  If you can
snag some of the old Tool's ratfor goodies as well, more power to you.

On the bit about starting out in Pascal vs. starting out in C, I would
say that C would give the budding programmer the advantage in life.
Agreed, the hill is steeper to climb, but once you're on top, you can
definately get a better view of the world.  One of the big complaints is
that the concept of the pointer is overwhelming to C neophytes.  The
reason why is because so many other langauges go through great contortions
to "insulate" you from the reality of memory and addresses.  Feel free
to flame on, but IMHO programmers program _machines_.  Anything that
goes to great lengths to insulate you from the machine is deprivation.
It's just a matter of how much deprivation is useful, and how much is not.
-- 
Michael Stefanik                       | Opinions stated are not even my own.
Systems Engineer, Briareus Corporation | UUCP: ...!uunet!bria!mike
-------------------------------------------------------------------------------
technoignorami (tek'no-ig'no-ram`i) a group of individuals that are constantly
found to be saying things like "Well, it works on my DOS machine ..."

fu043@zeus.unomaha.edu (02/17/91)

[a lot of previous discussion deleted]
> 
> K&R has got to be the worst book for learning C for a beginner that I have
> seen!  I used it to advance my knowledge, but it gave me headaches years ago
> when I wanted to learn the language.
> 
> The book by KELLY and POHL: TUBO C: The Essentials of C programming
> is one of the best I have ever seen (for the beginner).
> 
> Its method of explaining programs by dissection is excellent - voluminous
> details for each line a program.
> 
> The problems in each chapter are nice and easy adn complement the chapters
> extremely well.
> 
> There is no need to use TURBO C as there is very little that pertains to
> it specifically.  I believe there is also a product-nonspecific book
> available too.
> 
> Ray
> --
> University of South Australia   | Plus ca change, plus c'est la meme chose.
> P.O. Box 1                      | Ghing thien me how, ming thien gung me how.
> Ingle Farm                      | Knobs, knobs everywhere,
> South Australia                 |              just vary a knob to think!

I am not a novice, but I am a novice to C.  I'm currently enrolled in an O/S
course in which I am required to write in C, and the recommended C book we use
seems to be exactly what the original poster is looking for.  It is called
"A Book on C" (second edition) and was written by Al Kelley and Ira Pohl.  The
book does not presuppose any prior knowledge of programming, and starts out with
the very basics - yet it is organized in such a way that anyone with prior
experience (like me) could look up directly what they wanted to know.  The
sample programs are quite simple, with excellant explanations.  I also very
much like the fact that there are optional sections dealing with some UNIX 
and Turbo C fundamentals, if one of those is the platform that C is running on.
I would wholeheartedly recommend this book to be used for an INTRO I and/or
INTRO II programming curriculum.  I wish my own school had used it instead of
having Pascal for its intro courses.  The ISBN number is 0-8053-0060-0.

Jim McMahon