Found myself rereading this the other day, after recommending Chapter 8 to a young engineer seeking the Truth behind malloc(3)...still as fresh as the day it was printed, although I do note minor failings now (ubiquitous definitions of MAXLINE to 1000 rather than idiomatic use of ANSI/ISO's BUFSIZ, rather more use of register than I care to see in peacetime, etc). Also, when are we getting an update for C99? I'd like to see more people making proper use of stdint.h than is today typical.
Say what you will about C. I thought it close to perfect upon first grokkage back in that beatific summer of 1995. A year's eager detour into Prolog advocacy made absolutely clear the walls of the logical paradigm. Alexandrescu's marvelous work in metaprogramming was by that time mainstream, or as mainstream as it will ever be or need to be; for two years I became an effete C++ snob, until I realized just how poisonous it is when inflicted upon actual teams. The time was right to worship at Hindley and Milner's altars, and much joy was had hacking away in SML and OCamL—still wonderful languages, to which I return when my code needn't, say, read or write data. But while my heart might pump pure computation, my ass rests firmly before the loom of systems programming; short-lived, sweaty, heavy-breathed infatuations with Haskell, Erlang, and most recently Scala have left indelible imprints, but only on a mind aimed like a missile at hacking UNIX applications on supercomputers—or whatever's bigger.
(I've recently developed a curmudgeonly fondness regarding FORTRAN, largely due to an absence of pointer-aliasing issues (and thus massively simplified construction of optimizing compilers). This is more due to C99's baroque restrict system than anything else, and of course an unsatisfiable impulse towards contrarianism.)
And so I return always to C, not my first but certainly my most torrid and long-affected love. It's likely the only usable language I'll ever have truly memorized in all its detail. I've dreamed in C too many nights to count—not about discussing C, or debugging C, or writing C, but being C code and interacting with other entities as God meant us to: call-by-value reduction strategy. It is an imperfect language. Truth be told, it's in ways not even an acceptable language.
But I too am an imperfect vessel, and I've erected yet great castles in the air, from air, creating—by exertion of the imagination—real tools and potent effects. The greatest of these have shared one feature all: they were set down in the language of Kernighan and Ritchie, the syntactic heritage of systems programmers since the minicomputer era. Each year a few new hackers come under my wing, and more often than not it is my privilege to guide them through C's finer points. Frustration and puzzlement give way to understanding of, say, array-pointer equivalence or userspace threading via sigaltstack(2) trampolines, and in their delighted faces I see a bit of my youth...how many years spent in a phosphoric VGA glow, gnashing teeth, finally greeting sunrise with the wild-eyed exhilaration of Victory, screwing a Lucky Strike between my lips and knowing the problem has been solved? Millions of programmers around the world, thousands of epiphanies a second, synapses firing and recoiling by the trillion, transistors uncountable switching through forbidden zones from 0 to 1, all of them ordered by the principles set out in 189 pages plus appendices.
Well-played, sirs.
----
update: Dennis M. Ritchie exited with status code 0, EXIT_SUCCESS, 2011-10-13. He will be missed.
----
update 2, 2020-10-12: i have finally found a language better for most tasks than C: rust. still, fifty-odd years of dominance are nothing to sneeze at.
If you're a geek, you have to prostrate yourself in the direction of Bell Labs whenever this book is mentioned. I'm not really a geek, so it's optional.
Well, perhaps I'd better do it anyway. Just in case.
For evolution of the planet earth and our modern understanding of biology, there was Darwin's Origin of the Species. For mathematics, there was Newton's Philosophiæ Naturalis Principia Mathematica. Well, for the internet, for Facebook, for LinkedIn, Twitter, Instgram, Snapchat, WhatsApp, Pornhub amd even the odious website for Justin Bieber would never have existed without Kernigan and Ritchie (more affectionately known as K&R)'s classic, The C Programming Language. What language was TCP/IP written in? C. What language inspired both C++ and Java (and the abominable C#)? C. What language are most libraries on most operating systems written in if not assembler? C. The book is the raging hardon that spawned the last 40 some-odd years of quantum leaps in computer science and changed humanity forever? Am I exaggerating? Hardly. This book is highly readable (ok a bit dry but did you try reading Darwin or Newton? They are longer and dryer believe you me!). If you want to geek out on just one book then this is the one. RIP Ritchie and long live Kernigan!
I‘m in my second semester and we are being taught (beside algorithms) the C programming language. In the first semester we were introduced to this (for me) completely new world - world of programming - through Python.
As someone that had no prior experience with programming, this book had definitely helped and explained A LOT - it definitely (I‘d say) covers pretty much everything!
Even though I am still making some syntax errors (thanks Python😭), I‘m making some progress, which definitely keeps me motivated to continue with my practice in hope that I'll successfully learn it one day! 😅
Regardless of the fact that the architect of the language is a co-author, this book is simply not a good book on discussing the intricacies of C, a language replete with low-level details defining its behavior.
Everything, including a discussion on sequence points and side effects, among other topics, is included in Peter Prinz's and Tony Crawford's C in a Nutshell, which is masterful in its coverage of the language. Combine C in a Nutshell with Summit's C Programming FAQs and you have the entire language at your disposal.
I read this years ago when I was first taking C. I don't have this edition, but an earlier one. After wading through several other books, I kept coming back to this one as a reference while programming. It is deceptively short & sweet. Re-reads constantly found me more avenues to explore using their basics.
I gave a copy to my son & he came to the same conclusion. While other, larger, & more specific books come & go as C evolves, this basic work is a must for any serious programmer.
Excellent A+++++++ Would read again! The C Programming Language is THE VERY BEST way to learn the C programming language. Starting with the basic "Hello World" program, this book covers everything (of course, as the official guide to the language this is expected). As any programmer worth his salt will tell you, C is one of the most useful languages, and at least basic knowledge is mandatory.
You Say You Want to Learn to Program, Well, You've Got to Read This Book...
The C Programming Language (1978, rev. 1988) is rather totally the most important book ever written about computer science. As the language's name "C" indicates it was not the first language to include block form (that was Algol, a "committee" prototype language never used extensively in industry) and modern control structures, but its centrality and ubiquity in programming projects up to the present day has meant that one has to search far and wide to find a newer computer language that does not importantly incorporate elements from it. One of C's inventors, Dennis Ritchie, paired with Brian Kernighan to produce a slim introduction to programming in it (and, by extension, programming in general); the book has never been out of print since, and in fact has not been revised since the 2nd edition covering the ANSI standard for C in the late '80s.
That being said, someone with dreams of "coding" circa 2018 absolutely cannot pass up the minimal effort necessary to study and comprehend this book; one will be able to "parse" seemingly-terse C programs after reading it, and one additionally gets a postage-stamp introduction to the Unix operating system (the ancestor of Linux and macOS whose principles power the Internet). In reading it you not only learn the basics of C programming, but "absorb" an introduction to the style of thinking once known as "MIS", the practical business of Informatik more concerned with quantifiable success than the big dreams we read about today. Although there has been "price creep" for a basic trade paperback in recent years, it is still worth the price if you want to be a computer professional.
Ok dudes, this is THE book. If you want to know how to program in C, the once and future language of all computing, you must buy this book.
EFF this C#, CLI, J#, VB, and all those other abominational languages that are trying to kill good programming skills. If you want to learn how to really program you need to DO this book.
You don't read this book, you DO it! Thought I made a typo, huh? As a general rule, shorter books are better than those SAMS-type 1000 page tomes, teach you more, and are harder to write. When looking for a good technical book on any subject, make sure you try to find the small ones!
The book is missing many important parts of the subject. Also the explanations are not so good. Not suitable for someone who wants to learn the subject from scratch. May be an experienced professional might be able to benefit from the book better.
As for me I was just trying brush up the knowledge I had about this subject but didn't find the book that useful.
N/A For those uninterested in the historical context or don't want to know why this book iswas considered the de-facto book to teach oneself C (just knowing that it was, is enough trivia for the avg Programmer) before slightly better and updated alternatives like came along, just SKIP. It's 2021 and there exist way better and updated resources and for free.
So lucky I did read this book during the summer and started to audit classes using more serious language last winter... Otherwise, this first project of the semester would be even more of a struggle.
Skimming through this book was really enjoyable and fun. This book is not just about C programming language, but also about how to write good code in general. Reading this book is definitely recommended.
I can't say I learned how to program C using this book -- that distinction goes to the long-forgotten Microsoft Quick C for Windows manuals and a reference manual put out by the Waite Group. I can't even say that I need to consult this very often anymore, although it will quickly clear up any questions you might have about arrays of pointers to unions of structs.
This book is the ideal presentation of a language. (When was the last time you saw both the grammar and standard library of a language tucked into a couple of appendixes?) Don't read this book to learn C -- that a skill fewer and fewer people need to master. Read this book to learn how documentation ought to be written.
A great example of how to write a solid programming language tutorial: not too shallow, numerous complete programs, lots of good exercises. It's also a neat window into an earlier, very different time in the programming world.
This sometimes still makes lists of "best books for learning C", and I'm giving it a mediocre rating simply to push back against that. This book is older than I am; new versions of the language have been standardized three times since it was published, and the landscape of computing in general has changed drastically too. I was drawn to it out of historical interest, but if you just want to get a practical knowledge of C as efficiently as possible you should be looking for much more recent sources.
Used to remember reading this in high school (coming to me only in vague shapes of green with distorted contours of my school lab receding from my minds grasp)...
A masterpiece of pure technical brilliance. You gotta C and read() for yourself.
I'm not new to programming, but I'm no expert either. This book does say at the start that "some" programming knowledge is expected. That is an understatement. But the problem isn't how complicated the concepts are, the problem is one that plagues academia, and that is that the explanations aren't made with a focus on teaching, but rather with a focus on being so explicit in the explanations that it becomes robotic, as if the reader were a computer rather than someone learning about computers. This is not teaching. It almost feels like the goal is for the authors to show off how smart they are rather than to share their knowledge. I read concepts that I already know and understand well from having learned them in other languages, and the wording is so convoluted that it makes these extremely familiar topics seem foreign. They also have exercises throughout the book that are seemingly impossible to solve based just on the conents of the book, and there are no solutions to them. You can find the solutions online, but there are no official solutions approved by the authors, so you have to try and deliberate whether other peoples solutions are logically sound, but if you're still learning the language, you're not really equipped to make that kind of judgement, so you'll waste a lot of time trying to undertstand the problems if you're unable to solve them on your own.
Any software (hell, even hardware) engineer has hopefully heard about this book. If you don't own it, buy it right now! You won't find a single engineer on Earth telling you this is something less that awesome. This book achieves the perfect balance between terseness and exhaustiveness.
Computer Science book writers and publishers: can we go back to a writing style where computer books are in the 150 - 200 pages range, instead of the regular 600 - 900? Come on.
I simply do not understand why this book is so popular. I find it utterly unreadable and a pain in the butt to use. There are much better books introducing you to C, that serve as a reference to C, etc... Use if you want to impress your friends; otherwise, there are other places to look.
Oldschool but still relevant, just as the language. It's not a thick book, compared to the four times heavier C++ Primer and that's exactly how I feel about both languages. The C Prog. lang. does a fine job at explaining the key components of the C language using rudimentary code - and I like that, because that's what you'll encounter in the C world. The quicksort implementation using pointers for example. There's not much to say: it's a great introduction and reference, although learning C can easily be done on the internet. Pitfalls and strange usages of preprocessor flags are also covered.
do you know what SWE is? software engineering is when you tweak these pointers all night and order yourself a doordash pizza at 3 am of course in the morning you end up with big ball of mud throwing segfaults but that's what it's all about, then at 5 am you go to the convenience store and buy gold flakes and devour a whole dry packet and 3 beers that you shotgun, which is what i just did
good luck and have fun
(banger book btw, every language specification manual should be of this quality)
This is THE book for learning ANSI C. Kernighan's book does an excellent job holding your hand through the process of learning the basics of memory allocation and low level programming. Definitely an essential read for the entry level developer. Also, understanding the contents of this book is more than enough information to pass cppinstitute's CLA certification exam.
4 stars because the book is slightly outdated as far as legal and best practices.
Yet despite this, I believe there are alternative books which would have made the learning experience at first much easier.
If you have zero experience with programming or C in general, C Programming Absolute Beginner's Guide by Greg Perry and Dean Miller would be the best place to start. It does not get any simpler than this and the book is written with this in mind.
Dry. Boring. Outdated. Lack of imagery. Too much focus on memory management, not enough on UI or usability.
The lessons contained are sound, with examples. But it seems geared to weird, quirky problem-solving programming, like sorting and subclassing, rather than building or architecting of real-life applications. It would benefit from discussion of design patterns (MVC, singleton, etc) and usage in UI, to provide context to motivate the lessons.
Utile per chi vuole immergersi nel linguaggio di programmazione più comune, pur richiedendo delle basi di informatica non indifferenti. Dal mio canto, è stato utile come ripasso per l'essenziale del C.