[comp.lang.c] What's a good textbook?

ok@quintus.UUCP (Richard A. O'Keefe) (01/13/88)

I've been asked to recommend a textbook for someone with a math
background who wants to learn C.  I know about Kernighan & Ritchie,
and have Harbison & Steele.  Are there any other particularly good
textbooks, especially ones which don't assume quite as much of a
programming background?

pjh@mccc.UUCP (Peter J. Holsberg) (01/14/88)

In article <523@cresswell.quintus.UUCP> ok@quintus.UUCP (Richard A. O'Keefe) writes:
>I've been asked to recommend a textbook for someone with a math
>background who wants to learn C.  I know about Kernighan & Ritchie,
>and have Harbison & Steele.  Are there any other particularly good
>textbooks, especially ones which don't assume quite as much of a
>programming background?

YES!  If the person is a pretty good programmer already, then he/she
might try Kelley and Pohl's "A Book on C".  The same authors have a
slightly more elementary boof entitled "C By Dissection".

The Waite Group has one called "C Primer Plus" for the really new
programmer.  Steven Kochan's book is a good text for an intermediate
programmer.

Personally, I take my hat off to anyone who learned his/her C from K&R.
It just has too few examples and is too terse for me.

-- 
Peter Holsberg                  UUCP: {rutgers!}princeton!mccc!pjh
Technology Division             CompuServe: 70240,334
Mercer College                  GEnie: PJHOLSBERG
Trenton, NJ 08690               Voice: 1-609-586-4800

reggie@pdnbah.UUCP (George Leach) (01/14/88)

In article <128@mccc.UUCP> pjh@mccc.UUCP (Peter J. Holsberg) writes:

>Personally, I take my hat off to anyone who learned his/her C from K&R.
>It just has too few examples and is too terse for me.

Well, then Peter you will have to take your hate off quite a few times.
For many folks K&R was virtually the only book on the topic at the time
they were learning C.  In fact, as far as I am concerned, if you know
how to program in another language K&R should be sufficient.

Besides, it is the BIBLE!  Genuflect before opening it.


George W. Leach					Paradyne Corporation
{gatech,rutgers,attmail}!codas!pdn!reggie	Mail stop LF-207
Phone: (813) 530-2376				P.O. Box 2826
						Largo, FL  34649-2826

pjh@mccc.UUCP (Peter J. Holsberg) (01/19/88)

In article <2023@pdn.UUCP> reggie@pdn.UUCP (George Leach) writes:
>In article <128@mccc.UUCP> pjh@mccc.UUCP (Peter J. Holsberg) writes:
>
>>Personally, I take my hat off to anyone who learned his/her C from K&R.
>>It just has too few examples and is too terse for me.
>
>Well, then Peter you will have to take your hate off quite a few times.
                                             ^^^^
>For many folks K&R was virtually the only book on the topic at the time
>they were learning C.  In fact, as far as I am concerned, if you know
>how to program in another language K&R should be sufficient.
>

Well, George, it ain't my "hate" that I'd take off anyway!  And I don't mind
taking it off any number of times.  Just isn't a problem.

My contention, however, is that people who learned C before it became 
popular were good programmers, and that the folks who are taking it now 
are perhaps less able (given that we're talking about people with the
same levels of programming experience) as programmers.  For example, we
gave our first C course 2.5 years ago.  The students were almost all
systems programmers from local industry, and they could have learned from
almost any source.  Last semester, my students included "regular"
freshman/sophs, plus applications programmers (including COBOL-only types).
I know that many of them would have had a hard time with just K&R.

To test myself, I went back and looked at one of my copies of K&R, and found
it to be delightful to read.  It has everything in it with no excess
baggage.  However, looking at it as a student, I find it to be too terse,
and lacking in both examples and explanations.  A person learning C from
K&R would have to spend many hours testing and playing to understand their
examples.

I guess part of the problem is that K&R seems to have been written for 
the "Bell Labs level" person.  There's a need for a different kind of text
for the rest of us.  

-- 
Peter Holsberg                  UUCP: {rutgers!}princeton!mccc!pjh
Technology Division             CompuServe: 70240,334
Mercer College                  GEnie: PJHOLSBERG
Trenton, NJ 08690               Voice: 1-609-586-4800

mkhaw@teknowledge-vaxc.ARPA (Mike Khaw) (01/19/88)

From article <140@mccc.UUCP>, by pjh@mccc.UUCP (Peter J. Holsberg):
+ My contention, however, is that people who learned C before it became 
+ popular were good programmers, and that the folks who are taking it now 
+ are perhaps less able (given that we're talking about people with the
+ same levels of programming experience) as programmers.  For example, we
+..
+ To test myself, I went back and looked at one of my copies of K&R, and found
+ it to be delightful to read.  It has everything in it with no excess
+ baggage.  However, looking at it as a student, I find it to be too terse,
+ and lacking in both examples and explanations.  A person learning C from
+ K&R would have to spend many hours testing and playing to understand their
+ examples.
+ 
+ I guess part of the problem is that K&R seems to have been written for 
+ the "Bell Labs level" person.  There's a need for a different kind of text
+ for the rest of us.  

My personal experience agrees with the observations above.  When I first
tried to learn C from reading K&R, while still a novice Pascal user, I found
it impossibly terse and dry.  After delivering a number of substantial systems
written in Pascal, I tried K&R again, and found it succinct yet adequately
comprehensive.

Mike Khaw
-- 
internet:  mkhaw@teknowledge-vaxc.arpa
usenet:	   {uunet|sun|ucbvax|decwrl|uw-beaver}!mkhaw%teknowledge-vaxc.arpa
USnail:	   Teknowledge Inc, 1850 Embarcadero Rd, POB 10119, Palo Alto, CA 94303

jima@hplsla.HP.COM (jim adcock ) (01/19/88)

| I've been asked to recommend a textbook for someone with a math
| background who wants to learn C. Are there any other particularly good
| textbooks, especially ones which don't assume quite as much of a
| programming background?

/*$$ASBESTOS-SUIT ON */
/* ;-) ON */

IFF your friend is serious about math, and serious about programming, I
might (cautiously) recommend "The C++ Programming Language" 
by Bjarne Stroustrup, Addison-Wesley 1986.  It is very much along the
lines of K&R, but includes C++ information on how to write math classes
for mathematic entities more complicated than floating point numbers,
and have the resulting classes perform in pretty much the same way as
if they had been designed into the language from the start.  So your
friend could design complex math classes, vectors, matrices, sets, whatever,
and use them with standard "C" language mathematical notation: +, -, *, ++,
--, etc.

Needless to say, to use any of this stuff, you need a "C++" -type of 
"C" compiler.

ok@quintus.UUCP (Richard A. O'Keefe) (01/20/88)

In article <5260006@hplsla.HP.COM>, jima@hplsla.HP.COM (jim adcock ) writes:
> IFF your friend is serious about math, and serious about programming, I
> might (cautiously) recommend "The C++ Programming Language" 
> by Bjarne Stroustrup, Addison-Wesley 1986.

That's a fine book.  I have it.  I haven't got a C++ compiler.
The friend of a friend who wants to learn C hasn't got a C++
compiler, and doesn't want to learn C++.  He wants to learn C.
If you don't already know C, the C++ book is incomprehensible.

I've had about four serious responses to my request so far.  Thanks.
I'll wait another week and summarise to the net.  By the way, it
really was for a friend of a friend.  I learned C from K&R, which I
personally think is an improvement on most of its successors.

peter@sugar.UUCP (Peter da Silva) (02/03/88)

In article <140@mccc.UUCP>, pjh@mccc.UUCP (Peter J. Holsberg) writes:
> and lacking in both examples and explanations.  A person learning C from
> K&R would have to spend many hours testing and playing to understand their
> examples.

Anyone who learns a language without spending hours testing and playing with
it is a much better programmer than those of us who learned 'C' from K&R.
Or else they didn't really learn it...
-- 
-- Peter da Silva  `-_-'  ...!hoptoad!academ!uhnix1!sugar!peter
-- Disclaimer: These U aren't mere opinions... these are *values*.

pjh@mccc.UUCP (Peter J. Holsberg) (02/05/88)

In article <1429@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes:
|In article <140@mccc.UUCP>, pjh@mccc.UUCP (Peter J. Holsberg) writes:
|> and lacking in both examples and explanations.  A person learning C from
|> K&R would have to spend many hours testing and playing to understand their
|> examples.
|
|Anyone who learns a language without spending hours testing and playing with
|it is a much better programmer than those of us who learned 'C' from K&R.
|Or else they didn't really learn it...
|-- 
|-- Peter da Silva  `-_-'  ...!hoptoad!academ!uhnix1!sugar!peter
|-- Disclaimer: These U aren't mere opinions... these are *values*.

Oops!  I sure didn't express myself very well on that one!  I agree
completely that one doesn't really *learn* a language until one has done
much on-line playing with examples.  What I meant was that a text book
can be written so that it includes many good examples, each of which i
sexplained thoroughly.  See, for example, any of the "dissection" books
by Kelley and Pohl.  Having dissected examples gives the non-genius
student direction in his/her exploration on the computer.
.

-- 
Peter Holsberg                  UUCP: {rutgers!}princeton!mccc!pjh
Technology Division             CompuServe: 70240,334
Mercer College                  GEnie: PJHOLSBERG
Trenton, NJ 08690               Voice: 1-609-586-4800

lupin3@UCSCB.UCSC.EDU (-=/ Larry Hastings /=-) (02/05/88)

+-In article <184@mccc.UUCP>, pjh@mccc.UUCP (Peter J. Holsberg) wrote:-
+----------
|
| In article <1429@sugar.UUCP> peter@sugar.UUCP (Peter da Silva) writes:
| |In article <140@mccc.UUCP>, pjh@mccc.UUCP (Peter J. Holsberg) writes:
| |> and lacking in both examples and explanations.  A person learning C from
| |> K&R would have to spend many hours testing and playing to understand their
| |> examples.
| |
| |Anyone who learns a language without spending hours testing and playing with
| |it is a much better programmer than those of us who learned 'C' from K&R.
| |Or else they didn't really learn it...
| |-- 
| |-- Peter da Silva  `-_-'  ...!hoptoad!academ!uhnix1!sugar!peter
| 
| Oops!  I sure didn't express myself very well on that one!  I agree
| completely that one doesn't really *learn* a language until one has done
| much on-line playing with examples.  What I meant was that a text book
| can be written so that it includes many good examples, each of which i
| explained thoroughly.  See, for example, any of the "dissection" books
| by Kelley and Pohl.  Having dissected examples gives the non-genius
| student direction in his/her exploration on the computer.
| .
| 
| -- 
| Peter Holsberg                  UUCP: {rutgers!}princeton!mccc!pjh
|
+----------

  How interesting... I'm taking "Introduction to C" this quarter (so I'm
little precocious in reading this newsgroup...) and the textbook for the
course is "C by Dissection", by Kelly and Pohl.  Even more interesting is
that the teacher is Ira Pohl... he takes the subject quite slowly (well, it
seems real slow to me anyways..) but surely.  However, I also taught myself
some C over the summer, out of K&R...
  What I would say is that "C by Dissection" would be good for a beginning
user (someone new to computers, and Unix... the book is very Unix-specific),
wheras K&R would be good for a hacker who didn't know C yet.  K&R talks to
you on a very high level, kind of obtusely, and (while fun for hackers) is
very scary for neophites...
-- 
.. .  .   .    .     .      .       .        .         .          .           . .. .  .   .    .     .      .       .        .         .          .           .
   /\\\  |   _  _ _   _ |_| _  _ |_ -__  _  _ARPA: lupin3@ucscb.ucsc.EDU         /\\ \\\ L_ (_\( ( (_/  | |(_\_\ (_ || )(_)_\UUCP: ...!ucbvax!ucscc!ucscb!lupin3
l>c>>h>>>larry      /   hastings        _/   BITNET: lupin3@ucscb@ucscc.BITNET   \// ///  and they came out... and the last cow was jet-propelled...ZZZZZZ
   \///Disclaimer:My views don't reflect UCSC's, as theirs NEVER reflect mine...

pjh@mccc.UUCP (Peter J. Holsberg) (02/06/88)

In article <8802050815.AA01987@ucscb.UCSC.EDU> lupin3%ucscb.UCSC.EDU@ucscc.UCSC.EDU writes:
|
|  How interesting... I'm taking "Introduction to C" this quarter (so I'm
|little precocious in reading this newsgroup...) and the textbook for the
|course is "C by Dissection", by Kelly and Pohl.  Even more interesting is
|that the teacher is Ira Pohl... he takes the subject quite slowly (well, it
|seems real slow to me anyways..) but surely.  However, I also taught myself
|some C over the summer, out of K&R...
|  What I would say is that "C by Dissection" would be good for a beginning
|user (someone new to computers, and Unix... the book is very Unix-specific),
|wheras K&R would be good for a hacker who didn't know C yet.  K&R talks to
|you on a very high level, kind of obtusely, and (while fun for hackers) is
|very scary for neophites...
|-- 

If you taught yourself C from reading K&R, what are you doing ina  beginners'
class???  Looking for that easy A, eh?  :-)

I agree completely with what you say.  None of my students are  (or were)
hackers, so C by Dissection is a better choice than K&R.



-- 
Peter Holsberg                  UUCP: {rutgers!}princeton!mccc!pjh
Technology Division             CompuServe: 70240,334
Mercer College                  GEnie: PJHOLSBERG
Trenton, NJ 08690               Voice: 1-609-586-4800

levine@atpal.UUCP (Sysop account) (02/07/88)

Followup-To: 
Distribution: 
Organization: Ra
Keywords: 


Without commenting on whatever fun there may be in struggling through
difficult and obtuse works which may or may not relate to the machine
you are working on...

Let me add that I found >C Primer Plus< by the Waite Group and 
the sequal >Advanced C Primer Plus Plus< to be very readable, 
helpful and easily absorbed.  They are well organized, give many
examples, and serve as excellent references.

Secondly, if you are learning C on an IBM I highly recommend
>Microsoft C Programming for the IBM< also by the Waite Group.
K&R may be obligatory, but it is hardly a gentle introduction.

richw@rosevax.Rosemount.COM (Rich Wagenknecht) (02/09/88)

In article <102@atpal.UUCP>, levine@atpal.UUCP (Sysop account) writes:
> Let me add that I found >C Primer Plus< by the Waite Group and 
> the sequal >Advanced C Primer Plus Plus< to be very readable, 
> helpful and easily absorbed.  They are well organized, give many
> examples, and serve as excellent references.
> 

  I have used both texts above and can highly recommend them. Both are
excellent texts and in my opinion are preferred over K&R by those
learning C.





-- 
Rich W

richw@rosevax.Rosemount.COM
Disclaimer: My views may not represent my own much less my employer's.

wes@obie.UUCP (Barnacle Wes) (02/16/88)

In article <184@mccc.UUCP>, pjh@mccc.UUCP (Peter J. Holsberg) writes:
>                                      What I meant was that a text book
> can be written so that it includes many good examples, each of which i
> sexplained thoroughly.

Try Stephen Kochan's book "Programming in C" from Hayden Books.  As a
matter of fact, Hayden has a "Hayden Books Unix System Library," which
is edited by Kochan and Pat Wood, all of which I have found useful.
I've heard there is a book on Unix communications in this series which
I am still looking for.  I heartily recommend any book in this series
that you might need.  Titles include:

	Exploring the Unix System (intro to Sys V)
	Programming in C (intro to C, Unix flavored)
	Unix System Security (make the best of what you've got)
	Unix Shell Programming (sh, csh, and ksh - the only way to
		fly)
	Unix System Administration (the only way I kept my system
		going in the first few weeks!)

-- 
    /\              -  "Against Stupidity,  -    {backbones}!
   /\/\  .    /\    -  The Gods Themselves  -  utah-cs!utah-gr!
  /    \/ \/\/  \   -   Contend in Vain."   -  uplherc!sp7040!
 / U i n T e c h \  -       Schiller        -     obie!wes

gregory@ritcsh.UUCP (Gregory Conway) (02/25/88)

In article <61@obie.UUCP>, wes@obie.UUCP (Barnacle Wes) writes:
> Try Stephen Kochan's book "Programming in C" from Hayden Books.  As a
> matter of fact, Hayden has a "Hayden Books Unix System Library," which
> is edited by Kochan and Pat Wood, all of which I have found useful.
> I've heard there is a book on Unix communications in this series which
> I am still looking for.  I heartily recommend any book in this series


The extra book you are referring to is (I think) "Topics in C Programming" by
Kochan and Wood.  It is about 500 pages of Unix interfacing to C routines.
Not a bad reference if you program in a Unix environment.  ISBN # is:
0-672-46290-7. 

As a side note, I too learned C first from "Programming in C."
No flames, please, I own and have read K&R.  I thought the book
was an excellent one to learn from.  Let's face it, K&R is the bible of
C programming, but it can be a LITTLE hard to follow for a beginner.


-- 
================================================================================
Gregory Conway@Computer Science House    UUCP: ...rochester!ritcv!ritcsh!gregory
Rochester Institute of Technology, Rochester, NY
    "I got an allergy to Perrier, daylight, and responsibility", Marillion