Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This question has been haunting me because I'm now reading Kernighan & Ritchie's: The C Programming Language (K&R) but I meet a lot, and I mean A LOT, of C programmers that have never read it.

So, my question is: Is there an advantage to reading K&R? Should be a necessity?

share|improve this question

closed as primarily opinion-based by gnat, mattnz, GlenH7, Yusubov, Corbin March Sep 6 '13 at 12:39

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

K&R was written by the guys that invented the C language; for a long time it was the only C book available – Steven A. Lowe Sep 5 '13 at 23:01
No. The K&R book is not the only C book ever written. Depending on how you learn, another book may well suit you better. – user16764 Sep 6 '13 at 0:49
@StevenA.Lowe: Note that having created and developed the language doesn't necessarily give you the best credentials to write about it. For instance Gosling notably said not considering himself a Java expert. And I'm not sure I enjoy Stroustrup's writings that much on C++ in general. Obviously they know what they're talking about on the technical parts of the language, but using it to its fullest, defining style and making it part of a viable ecosystem is a different thing entirely. (though I think that K&R did that amazingly well) – haylem Sep 6 '13 at 10:57
@user16764: "no" to "should be a necessity?", I hope, not to "is there an advantage to reading K&R?" – haylem Sep 6 '13 at 10:58
@haylem: of course. the K&R book is quite good, fortunately, but I see no obvious advantage to reading it instead of or in addition to other C resources – Steven A. Lowe Sep 6 '13 at 16:54
up vote 13 down vote accepted

Helpful yes, necessary no. K&R is not the definition of the C language. It's simply one of many introductory texts. I found it particularly clear and concise, but other readers may prefer other texts. Simply having read it doesn't set you apart from other programmers in any way.

share|improve this answer
so you're telling me that whether or not I read it doesn't make a difference ? – Farouk Jouti Sep 5 '13 at 21:44
Reading K&R and doing the exercises is a perfectly fine way to learn introductory C. However, there are plenty of other books and resources for learning C, and having chosen K&R over one of the other books does not in itself demonstrate your competence as a programmer. – Charles E. Grant Sep 5 '13 at 21:50
Of course, you could always learn c the hard way. – Robert Harvey Sep 5 '13 at 22:24
K&R removed the fear of learning it for me. It's almost as if they were sitting next to me explaining things in a homey, friendly chat. That is the value of "the white book". (And I learned it in 1985) – Rob Sep 5 '13 at 22:29
@Rob: Yes, it is a very friendly book and it is very approachable. I consider this one of its greatest assets, along with very clear examples/exercises. – haylem Sep 6 '13 at 1:57

I'd agree with Charles E. Grant: it's not necessary, but it's worth the read, and here's why I think so:

The Bad Stuff

  • It's dated and thus could be confusing.
  • If you already know C well you won't learn much.
  • If you're not a fan of the K&R code style, your eyes might burn.

The 3rd point being insignificant, and the 2 first points being relatively painless, at least you know reading it won't hurt.

The Good Stuff

  • It's a good introduction for novice programmers, both for C and programming in general.
  • It's a nice read (as in: it reads easily and is well written).
  • It's not only about the technical value, but also about the historical value. If you aim at being an expert, it's good to know how the language evolved, so it's good to have a look at a book that was around not that long after its genesis, and one of the language's most famous books at that. C has changed. Not knowing the old bits may not be useful if you don't have to use them but it may help a great deal if you run into older code, or if you wonder why some things were done one way or another.
  • Again, it's about the history. Reading "Hackers" from Steven Levy or "Dealers of Lightning" from Hitzlick doesn't teach me anything of technical value, but it's anecdotical. Somehow, I find K&R to be of great value in this regard as well.

It's not a waste of time, so I'd say grab a copy at a local library and leave it on your desk. Pick it up at some point, and you may be surprised that there was a small hole in the space-time continuum when you raise your head again.

share|improve this answer
+1: I agree with "If you already know C well you won't learn much.", but many (if not most) C programmers who read it for the first time find they did not know C as well as they thought. – mattnz Sep 6 '13 at 1:43
@mattnz: Yes. (That being said, I'm afraid that's not specific to C and to this book in particular. We tend to think we know things better than we actually do.) – haylem Sep 6 '13 at 1:56


It isn't much good if you want to know how to write programs using the current versions of C, but--

It explains very clearly why the language looks like it does and the intention behind some of the basic design decisions.

If you are ever asked to document anything "The C Programming Language" is the absolute example of how to do it. Well organised, clear, concise and readable. Its written on plain English with a minimum of Jargon and zero buzzwords.

share|improve this answer

I’m not sure you’d learn anything different from K&R than from other C books, but I tend to believe that you can learn quite a bit about people from seeing what books they prefer to read about a subject.

  • K&R is a well written and concise book, but a bit clichéd as a recommendation.
  • My personal favorite was Harbison & Steele, just as well written as K&R, but considerably more detailed.
  • If somebody prefers a book in the “…for Dummies” series, I would suspect their dedication to their craft, not because those books are all that bad, but because they don’t go very deeply into details.
  • If somebody swears by books written by Herbert Schildt, they have the will to go into details, but I would suspect their judgment in the books they picked.

In general, I don’t think the time spent reading a quality technical book (and K&R is definitely one, and not a very long one) is never wasted.

share|improve this answer

Yes, K&R is indispensable.

You have to read it, in the same way that you have to read Hamlet and Lord Of The Rings, in the same way that you've got to see Casablanca and Gone With The Wind and Star Wars.

It's a terrific little book. It changed programming, and it transformed technical writing, and for a generation it represented the pinnacle of style.

What do you gain by not reading it? Six hours? Twelve? Twenty? If you're serious about programming, you're going to be spending thousands and thousands of hours casting code. if you can't bother to read, what else can't you be bothered to do?

It's entirely possible that K&R shouldn't be your first C book. And nowadays, C shouldn't be your first language. It's not vital to read K&R first, but you've got to read it.

And why wouldn't you want to? It's fun.

share|improve this answer
It's a bad analogy in my opinion. I think people should read these books, but yet again there are countless books and movies one should see, and seeing or not seeing them the vast majority will not be a strong indicator of anything. Also, that's quite culture-specific if you think everybody needs to have read them. You also wrongly assume that the time not reading K&R is time wasted. You don't know how the OP schedule, for all you know maybe he or she was planning on using this time for 57 other unreplaceable books you did NOT mention. – haylem Sep 6 '13 at 5:57
Also, and while I have at time advised some people to start with other languages than C, I'm a proponent that it should be taught early and taught well. Basically the only thing I can heartily agree with in your answer is: "It's a terrific little book. It changed programming, and it transformed technical writing, and for a generation it represented the pinnacle of style." (though I'm not even sure about the latter part which also seemed grossly generalized to me) – haylem Sep 6 '13 at 6:00
Pushing your reasoning, everybody should read Euler's "Elements of Algebra" or "Brāhmasphuṭasiddhānta". After all, they changed their field both because of their content and of their form and were at some point the pinnacle of style, probably for a quite a few more generations. Surely not reading them is a grand waste of time. – haylem Sep 6 '13 at 6:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.