k&r book

M

Morris Dovey

conrad said:
i've been told that k&r doesn't actually teach ansi C properly
is this true?

Worked well for me. I learned from the first edition; and use the
second edition from time to time as a quick reference. The second
edition seems fairly current.

Have you experienced difficulty learning from the book? You're
invited to ask for help/clarifications here.
 
C

CBFalconer

conrad said:
i've been told that k&r doesn't actually teach ansi C properly
is this true?

It, and any other book, does not teach. However it is quite
possible for those skilled in the art of reading to learn from it
(and other books).

Should I be misconstruing your question, there are slight failings
in C90 conformance. Most of them are covered quite adequately in
the errata.

Should I still be misconstruing your question, yes it does not
adhere to Ansi C as of 2003, which is actually C99. Ansi adopts
the ISO C standard bodily. Since the book was written about 10
years before the C99 standard was published, I don't consider this
a fatal flaw.
 
M

mcheu

i've been told that k&r doesn't actually teach ansi C properly
is this true?

There's a newer edition of "Programming in C" by the Kernigan and
Ritchie pair with fake stamp on the cover that says "ANSI C Edition".
I saw it on the shelf at the local Chapters last year.

The original 1970s edition doesn't teach ANSI-C, but I would hope that
this edition would -- considering the title.
 
K

Kevin Goodsell

mcheu said:
There's a newer edition of "Programming in C" by the Kernigan and
Ritchie pair with fake stamp on the cover that says "ANSI C Edition".
I saw it on the shelf at the local Chapters last year.

The original 1970s edition doesn't teach ANSI-C, but I would hope that
this edition would -- considering the title.

That's the second edition. It is intended to cover ANSI C (C89), and
does so quite well. There are errors, as there are in all books. The
concerned reader should consult the errata list.

-Kevin
 
E

Elliot Marks

Richard said:
K&R2 is, in fact, quite superb.

Would you recommend it as an introduction to the general subject of
programming, that is, to someone completely new to the subject?
 
M

Mark Gordon

Would you recommend it as an introduction to the general subject of
programming, that is, to someone completely new to the subject?

If they are starting with C then I would recommend that they get K&R2
*and* a good programming tutorial.

To quote from the Preface to the First Edition, "The book is not an
introductory programming manual; it assumes some familiarity with basic
programming concepts lie..."

That said, some people have learnt to program from K&R so it is not
impossible and it is IMHO an excellent reference book as well as being a
good C tutorial.
 
D

Dan Pop

In said:
Would you recommend it as an introduction to the general subject of
programming, that is, to someone completely new to the subject?

Yes, it teaches a lot more than just C.

Dan
 
E

Eric Sosman

Dan said:
Yes, it teaches a lot more than just C.

Dan apparently holds a high opinion of the programming
aptitude of the populace at large ...

IMHO, a complete beginner needs to learn some fundamentals
that K&R omit. Chief among these is the understanding that
computers are both literal-minded and stupid; they'll do what
you tell 'em even if you tell 'em something ridiculous. Since
programmers spend a lot of effort trying to get their software
to appear smart, beginners are often unaware of the intrinsic
thoughtlessness of the "thinking machine."

That, I think, is the single most important thing to know
about computers. Beyond that, the beginner must acquire some
knowledge of binary arithmetic, comprehend why 1/3 and 1./3
are different, appreciate that 1./3*3 might not equal 1, have
some idea of why one would want to write a subroutine, and so
on. K&R start from the premise that the reader already knows
such things, and address themselves to how C deals with them.

You've got to know what "intransitive verb" means before
you can make full use of a English-German dictionary.
 
D

Dan Pop

In said:
Dan apparently holds a high opinion of the programming
aptitude of the populace at large ...

Of the populace that is really motivated to learn computer programming.
That's quite different from the populace at large...

More than one person claimed, in this very newsgroup, that he learned C
from one K&R book or another with no prior exposure to computer
programming. So, it's possible.

Dan
 
R

Richard Heathfield

Elliot said:
Would you recommend it as an introduction to the general subject of
programming, that is, to someone completely new to the subject?

Yes if the student is being taught programming by a good teacher who is also
a good programmer.

Also yes even if the student is self-teaching, provided he or she is a
bright bunny.

But there are other books, the two obvious choices being Deitel and Deitel,
and of course K N King. The clever student with access to an excellent
bookshop will go to that bookshop, take all three books off the shelf, sit
down with them for half an hour over a cup of coffee, and browse through
them trying to decide which of them seems to match his or her mindset most
closely.

And then buy all three of them anyway. :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,109
Messages
2,570,671
Members
47,262
Latest member
EffiePju4

Latest Threads

Top