32 years on, K&R's "The C Programming Language" still stands alone
reprog.wordpress.com
reprog.wordpress.com
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.
In contrast, the C++ programming language is a mouthful, and ended up being just another pretty book on my bookshelf.
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!)
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.
http://www.amazon.com/review/RMXKDJNH8UOPU/ref=cm_cr_rdp_per...
But I think you're being unfairly selective in your quoting of the original article. _Immediately_ after the part you excerpted, it continues: "(Er, assuming you have the patience to go on to accumulate a decade of experience leading to wisdom, taste, good judgement and technical intuition.)"
Read a good algorithms text to learn about balanced trees. Once you understand what one is, you ought to have learned enough about C from K&R to be able to implement one in C.
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.
Of all the C++ books, there was a C++ in 10 minutes from SAMS that was small, dense packed, and informative. It was really weird coming from them.
Had anyone used both? Will I get downmodded for asking another question?
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.
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.
i've mentioned preferring this book over k&r here before, but as someone pointed out they do slightly different things - k&r is more about teaching how to use c.
but apart from all that, how come you get to use fortress frequently? what are you doing? is it becoming more popular? has it survived oracle?
And nowadays I too keep Harbison and Steele handy, I lost track of my copy of K&R sometime in the '80s.
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.
I'm glad the other book worked for you though!
K&R ... I don't know. To really judge it, I'd want to e.g. look at the Algol 60 spec, and some inbetween.
Anyway, I'm not sure it's a "cult" book, but I do agree it's overrated (see my other comment; at the time I found the Lions' Commentary to be the better tutorial, but it had that tiny problem of being samizdat).
Personally I adore both books. I do find H&S more useful particularly because it is more comprehensive and up to date (very good coverage of C99, not just a listing of changes in some appendix but has discussions about C99 throughout the book).
These are the only two books I bought _after_ reading them from front to back as they are a must have for my library.
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.
http://www.reddit.com/r/programming/comments/bn8y5/kernighan...
What the hell ;)
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.
char * (*(** foo[][8])())[]
declare foo as array of array 8 of pointer to pointer to function returning pointer to array of pointer to char
Which do you prefer reading?If C made us declare foo using the second format you gave, we'd still have to write, e.g., ((foo[12][3])())[7] in the code where we are actually trying to use foo.
Can you look at a declaration in the second format, and compare to where the variable is used, and see quickly if the usage is correct? With the current declaration format, it's easy--because declaration and usage use the same format.
Lacking brakes.