Hacker News new | ask | show | jobs
by _l4jh 2121 days ago
I've been programming in C for twenty years now and K&R has a special place in my heart however I do not think it is the best book for a beginner to learn C.

If you're coming from COBOL and wanting to learn C (like the target audience at the time the book was written) ok perhaps it is a good book for you. But if you're coming from something like Python or Java or JavaScript (or even no language at all) there are better options such as K N King's A Modern Approach.

K&R is a fantastic book in its own right and I certainly think once you feel more comfortable with C it is a superb book to read and more importantly complete as many of the exercises as you can.

It is that I have seen too many people come from higher level languages or with no programming knowledge and find K&R frustrating due to its assumption the reader is already a programmer in some other (1970s) language with a fundamental understanding of some programming concepts.

3 comments

K&R is a worthy historical artifact on its own, documenting the then prevailing programming styles and problems of interest, and the overall cultural vibe of the programming community back then. It just takes you back to the creative and somewhat unorderly 1970s atmosphere in Bell labs, with its former hippies now wearing big glasses and colourful sweaters.
Working at Bell Labs in the 70s/80s must have been interesting.
Thanks, this is really useful info for someone who wants to learn C coming from Pyhon, etc.
I think it’s a great book to read first; it is concise and correct and gives a very good idea of what C is about. However, I would immediately follow it up with the newer parts of C, going more into the modern definition of undefined behavior, practices to keep your code correct in larger applications, how to debug issues, etc.