
32 years on, K&R's "The C Programming Language" still stands alone - MikeTaylor
http://reprog.wordpress.com/2010/04/06/programming-books-part-4-the-c-programming-language/
======
mrcharles
I think it says something that K&R C, as a book, is significantly more
readable and concise than most programming books nowadays. Part of it is the
language, but part of it is simply how the book is approached. Simple
statement, simple example, move on.

I mean, compare that book to the other programming books on your shelf. It is
positively minuscule. And if you compare the writing to that in a more modern
programming book, there's certainly a lot of wasted text in newer books.

My latest programming book is The Essential ActionScript 3.0 by O'Reilly, and
there's way too much embellishment in the text. Not only does it make it
longer to read, but it also makes it harder to find particular information,
and quickly absorb it.

I learned C almost exclusively from K&R C, and I know many others did too, and
to this day I wonder how it is that all these new programming language books
can be such monolithic texts.

"Essential", they say.

~~~
madtantric
I found Doug Crockford's "Javascript: The Good Parts" to have the same
qualities as K&R's C book. Concise, readable and dense, a 'must read' for
aspiring Javascript programmers.

------
somebear
The thing that has always struck me about K&R is that it contains no fluff.
You get so much information for each paragraph, that you often have to re-read
them to get all the information contained therein. Probably the programming
book I've used the most.

In contrast, the C++ programming language is a mouthful, and ended up being
just another pretty book on my bookshelf.

~~~
tptacek
Stroustrop is, or at least in its later editions became, a pretty
indespensable C++ book. Most of the topics in C++ are best addressed by it.
Unfortunately, C++ is a nightmare of a language, so there are many, many
topics, and you don't read it cover-to-cover any more than a cook would read
New Pro Chef or McGee cover-to-cover.

~~~
protomyth
The copy of Stroustrop's book I have has all of the program text in a
proportional, italic font. It was murder on the eyes.

------
tptacek
_There is, essentially, nothing to be known about C beyond what is in this
book. If you can read those 272 pages, and understand them all, then you are
well on the way to being a C wizard._

Say what? This is like saying that once you know what all the commands in
Illustrator do, you're well on your way to being a professional illustrator.
The reason that K&R is so small is that so much of C programming happens
outside/above the language.

I like K&R a lot, and I won't argue that it's the best soup-to-nuts C book
(though I recommend C Interfaces and Implementations more heartily). But if
everything you need to know about C is in K&R, how do you implement a balanced
tree?

( _I caught myself typing "how do you implement a hash table", and remembered
that K &R actually has a hash table in it. Damn you, K&R!_)

~~~
mavelikara
@tptacek and others on this thread, what books do you suggest to learn modern
C programing? I am an experienced programmer, but all of my experience has
been with JVM languages. I would like to be able to read and debug C/C++
programs - so which books provide a good start on idioms, libraries and tools?

~~~
tptacek
_C Interfaces and Implementations_ by David Hanson.

I'm using it as the textbook for a weekend C class I'm about to run for a
bunch of Ruby/Java programmers, because CII basically gives you back all the
data structures you have in Ruby that C "takes away" from you.

It'll also teach you a style of C development (ADT-centric, modular, heavy on
function pointers) that holds up pretty well and is relatively modern.

~~~
kqr2
This looks like tptacek's review on Amazon:

[http://www.amazon.com/review/RMXKDJNH8UOPU/ref=cm_cr_rdp_per...](http://www.amazon.com/review/RMXKDJNH8UOPU/ref=cm_cr_rdp_perm)

------
protomyth
It was written in a different era where publishers weren't inflating page
counts for sales.

~~~
_delirium
It doesn't hurt that the total number of constructs in K&R C is really quite
small. I'm not sure there are any current languages with comparably few
constructs; maybe Arc. Even Scheme is bigger, at least for a recent version
(say, R6RS).

~~~
hga
True, but the revolt against R6RS has been ... _fierce_. None of the new
steering committee members was in favor of it and we expect a move back
towards the old virtues.

Still, Scheme does try to address a lot of higher level things, e.g. the full
numeric tower, whereas C shines as a universal very close to the metal
assembler.

------
obsaysditto
The first and probably only programming book I've read completely.

~~~
flatline
"Learning Perl" was the first one I read all the way through. I read most of
K&R, it was a similar experience, many years after reading the Perl book.

------
afterburner
How does it compare to C Programming: A Modern Approach, by K.N. King? That
was great for learning C. Very readable.

~~~
afterburner
Really, downmodded for politely asking an honest question?

Had anyone used both? Will I get downmodded for asking another question?

~~~
eru
Kneejerk downmodding has become somewhat epidemic recently (in the last few
months?). Most of the time more thoughtful users tends to correct this problem
later on, though.

~~~
nitrogen
It probably helps that downvoting is only possible for newer posts (at least
from my perspective), while upvoting is always possible.

~~~
eru
I usually compare on what I think a comment is worth and what it has at the
moment, and then vote to make the `is' closer to the `should'. At least for
upvotes. In generally I only downvote stuff that lowers the quality of
discussion.

It would be interesting if we had a voting system, that worked a bit like
eBay's `bidding agents'. I.e. a system where you vote by setting a target
score, and the system casts an up- and downvote as necessary. Of course we
would need those base-votes to be recastable (but only automatically).

The current system is a special case of this, where the target score is either
plus infinity or minus infinity, and you can't change the target score once
set.

P.S. Please forgive my off-topic ranting in this discussion about K&R.

------
larsberg
I personally find Steele's C: A Reference Manual far more useful in day to day
hacking.

But, that's one of four Steele-authored language specs I look at frequently
(Common LISP, Scheme, and Fortress), so I might just have carefully tuned my
search methods to his writing style.

~~~
kijuhygfhjk
But Steele isn't much thicker. It's not hard to see that he was sticking to
the K&R philosophy .

~~~
hga
Not really, unless page count is your only metric. If you've read any of
Steele's other language definition books (I've read all of the first Common
Lisp one and some of the Java 3rd edition), you'll see it's clearly in the
same style as the others. Also not entirely like the Scheme Revised Reports,
which _really_ set the standard for conciseness ^_^.

------
neovive
This is one of the few books I've kept on my bookshelf for many years and
still read through it every so often for a C syntax refresher. It's a great
read since C syntax and conventions are still so pervasive in many of today's
languages. Perhaps, it is one of the few programming books that can be passed
down from one generation to the next.

------
blub
K&R is overrated, just like many "cult" books are. I read C: ARM by Harbison
and Steele and after trying to read K&R I stopped because I wasn't getting
anything new out of it.

Edit: Further proof of this is the blind downvoting typical of critiques of
"cult" books. K&R just happened to be there at the right time and it was the
first programming book for many people. Their nostalgia makes them think that
it is a very good book, when in fact is a simple book that describes a simple
language. Nothing bad about that, but nothing spectacular either.

~~~
DennisP
I'm reading it for the first time right now, and without nostalgia, at 100
pages in I'm very impressed.

~~~
nearestneighbor
Flip to the part about longjmp, and see if you still are.

------
senki
That was my first programming book, and I learned not only C from it, but
programming in general. It's been translated into many languages, I read it in
Hungarian. Check out the various covers: <http://cm.bell-
labs.com/cm/cs/cbook/>

------
drallison
K&R's C Programming Language is like the language: spare and elegant. It is
not a beginner's book and does not coddle the reader. It is a book for
programmers. And it reads as well today as it did 32 years ago.

------
kschua
Ah... this book brings back memories for me. This is the only programming book
that I read till the end three times, not to mention the countless other times
I use it for reference. The only book that can almost match this book is
Effective Java Programming.

These are the only two books I bought _after_ reading them from front to back
as they are a must have for my library.

------
b3b0p
This is one of the very few if not only tech books I cherish and would never
let go of. I'm not a C guru, I did a lot of C in school, but since then almost
none.

I've been wondering when or if I can get this on the iPad. Even though I own
the hardcopy, it has seen better days and it's starting to lose it's binding.

------
sigzero
The first post here could not have said it better:

[http://www.reddit.com/r/programming/comments/bn8y5/kernighan...](http://www.reddit.com/r/programming/comments/bn8y5/kernighan_and_ritchies_the_c_programming_language/)

------
l0nwlf
K&R is not only about C. It is about programming practices in general and is
content-packed. So much power in so thin book, just like C itself, a language
with only 32 keywords.

------
Hexstream
"Ritchie, right, auditioning for the role of Saruman."

What the hell ;)

------
Dellort
Very nice semantics, but hideous syntax. Pascal had it done right with a more
linear declaration syntax. C looks like lisp in a bad way if you make slightly
nontrivial declarations. Of course to make matters worse somebody went on and
made C++, which must be the most hideous language ever to evolve, possibly
because its creator borrowed heavily ideas from how his native natural
language Danish was formed; It is mostly comprised of guttural sounds and
every new groan you make is added to the language. It has been said that C++
is to C what lung cancer is to lung.

Basically we will never get rid of C, for there is just too much piled up on
it. C++ though we should replace because it is an atrocity to programming.

~~~
MikeTaylor
C's syntax is much more terse than Pascal's; whether that makes it better or
worse is open to discussion. _begin...end_ or _{...}_? I would argue that
Pascal's syntax is easier to learn, but that C's is easier to use once
learned. And since I spend more time using languages than learning them, the
latter is more important to me.

~~~
magoghm
In the 80's we used to say: "You can't compare Pascal to C. It's like
comparing a bicycle with training wheels to a ten-speed racing cycle."

~~~
eru
> to a ten-speed racing cycle.

Lacking brakes.

