Archived

This topic is now archived and is closed to further replies.

pizza box

"The C Programming Language" by K & R - Worth Reading?

Recommended Posts

I''ve purchased several books over the past few years on C, C++, Windows, etc., and one of them happened to be The C Programming Language by Kernighan and Ritchie. I''ve heard good things about this book, since the author is also the creator of the language, but since it is quite dated compared to some of my other books, I was wondering whether or not it is still worth reading? I''ve read C++: The Complete Reference by Herb Schildt and I have a good understanding of the language. Just curious as to whether K & R''s book has any additional tips or tricks about the language. P.S. Although this may seem trivial to some, I do not have much free time so I try to read anything that would help me expand my programmig knowledge. Also, I am a very slow reader so the 200 or so pages would take me quite some time to read and understand as well. Thanks for you time. Adam Sheehan

Share this post


Link to post
Share on other sites
Schildt''s books are universally seen as abominations, forget all you learned from them.

The K&R is the ONE true reference about C. Studying it attentively might undo the brain damage you got from listening to Schildt.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]

Share this post


Link to post
Share on other sites
No. It doesn't cover any new C99 features. Because it's so goddamn old! The 2nd Edition is dated 1988...

On top of that, it's dry and completely out of order. Like, in the first chapter they gave an example program that had loops and such, then, going through program one section at a time explained comments, declarations, variables, arithmetic expressions, loops ... Something you wouldn't quite expect in a first chapter.

Plus the authors thought they were teh 1337est hAx0rs in saying shit like "C is a general-purpose programming language which features economy ofexpression, modern control flow and data structures,... " or they use the word "compute alot...

On top of all that, almost half of the book talks about outdated UNIX crap. Not very useful if you're programming Windows.

And I wouldn't say there are any "additional tips or tricks" there.

I bought this book and I knew right off the bat that the authors were programmers and not authors !

My opinion: Just read more recent books like C Primer Plus (which is over -detailed) or other ones such as(like you said)C++: The Complete Reference .

[edited by - Fucho on October 19, 2002 10:14:41 PM]

Share this post


Link to post
Share on other sites
Fucho, please don't post if you have no idea what the hell you're talking about. You'll only make an ass of yourself.

EDIT: Since you are learning C++ as well, "The C++ Programming Language" (3rd edition) could be very helpful. It's an amazing book, also by the creator of the language, and it is pretty new. I haven't actually read "The C Programming Language", but I'm guessing that TC++PL includes most of the things in TCPL.

[edited by - micepick on October 19, 2002 10:19:03 PM]

Share this post


Link to post
Share on other sites
The K&R book is an excellent reference. But keep in mind that it is about C, not C++. So it won't give additional tricks about C++ features. But if you're looking for a deeper understanding of the C language, then this book is highly recommended.

And please let me reiterate Fruny here, because this is important: Do not buy Herbert Schildt books - Never. Have a look at reviews of his books at ACCU.org, they are all devastating, without exception.

If you're looking for a reference about C++, get this one by Stroustrup.


[edited by - Yann L on October 19, 2002 10:25:06 PM]

Share this post


Link to post
Share on other sites
fucho, do you have any idea who Kernighan is?

I suppose you''ll be telling everyone that Foley and Van Dam were just a couple of hAx0rs as well?

I suggest you do a little reading up on the history of C.

Share this post


Link to post
Share on other sites
Thanks for the replies. Glad someone pointed out Schildt''s errors because the book seemed like a good source for C++ material. I''ll be more cautious when reading it now. Also, thanks for any recommendations you made for other C++ related material, right now I am looking for a good, reliable source to the language and it seems a lot of books aren''t doing the job. If you have any more suggestions or criticisms, please post. Thanks for your time.

Adam Sheehan

Share this post


Link to post
Share on other sites
quote:
Original post by Darrell L
fucho, do you have any idea who Kernighan is?

I suppose you''ll be telling everyone that Foley and Van Dam were just a couple of hAx0rs as well?

I suggest you do a little reading up on the history of C.


Look, I just thought they wrote it in a nerdy way. AND the book doesn''t cover any new C99 features, wich was my main point.

Share this post


Link to post
Share on other sites
Most compilers don''t support C99 features. Most C programmers don''t use them. Lack of information about C99 is not really a problem for a general-purpose C primer.

Phrases like "economy of expression" are in there because they are standard phrases. If the authors expect an audience that wouldn''t know them offhand, yet don''t define them, then that''s a problem. But don''t complain about a programming book just because it has big words in it that you have to look up.


Don''t listen to me. I''ve had too much coffee.

Share this post


Link to post
Share on other sites
quote:
Original post by Sethius Also, thanks for any recommendations you made for other C++ related material, right now I am looking for a good, reliable source to the language and it seems a lot of books aren''t doing the job.


C++ Language - The C++ Programming Language, by B. Stroustrup, latest edition
Standard Library - The C++ Standard Library, a tutorial and reference, by N. Josuttis
(Re) Learning - Accelerated C++, by A. Koening and B. Moo

And yeah, keep an eye on the ACCU reviews.

Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]

Share this post


Link to post
Share on other sites
quote:
Original post by Sethius
Glad someone pointed out Schildt''s errors because the book seemed like a good source for C++ material. I''ll be more cautious when reading it now.



Wait a minute... NO, what are you doing! BURN the book!

Share this post


Link to post
Share on other sites
I really really like bruce eckel''s c++ book. It''s great for intermediary folks who want to know more than intro books tell you. Actually, this book is for those who want to improve their c++ skills since it does show various design situations one encounters on daily basis. I think the c++ standard or the msdn c++ spec. book are the next step after this book. For beginners I recommend wrox''s Herb''s books, the author whose two books are packaged with msvc++6 compiler(one on mfc/atl/activeX the other on c++). The "teach yourself c++ in 21 days" is also good but not as deep as eckel''s book. For STL I think Scott''s Mayer''s Effective books are a good bet. I read some short book excerpts and learned couple of things, though can''t wait until eckel''s vol.2 STL/Patterns books is finished. He has a Patterns book in Java for those who care. It has a factory and some other useful patterns. For STL specs, why the headers of course yuck! Though they are addictive.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Have we all been tricked into buying herbs books? Gamedev has ''C++: The complete reference'' ranked as the best C++ in the review. And your saying his books are bullshit?

Share this post


Link to post
Share on other sites
I use C++ a beginner''s guide by Herbert Schildt which seems like a good book. Should i get rid of it before i learn more bad habits.

Share this post


Link to post
Share on other sites