Hacker News new | ask | show | jobs
by satysin 3564 days ago
Personal opinion - (in order from beginner)

* C Programming Absolute Beginner's Guide by Perry and Miller

* C Programming A Modern Approach by King

* Programming in C by Kochan

* C Primer Plus by Prata

* Head First C by Griffiths & Griffiths

* 21st Century C by Klemens

* Understanding and Using C Pointers by Reese

* Expert C Programming - Deep C Secrets by van der Linden

3 comments

Interesting list. Not worked much on C recently (though I am some on D these days), but had used it a lot earlier. I first started with K&R (not because I knew it was good or the best then - IMO, maybe some will not agree, and it may not be the best for a beginner), but because it was the only one available at that time and place, IIRC. Later I did read some other C books. I think the Kochan (Steven?) one you mention was one of them, and maybe also the Prata book. IIRC, the Kochan one was good. One book I read had an example of creating an index or concordance of a text file or program, maybe it was Kochan. Remember enjoying the logic.
You were not the first person to suggest Klemens's book to me, but after reading it, I disagree with most of it.
Did you read the first or second edition? The first edition had a lot of issues, the second edition was a lot better.
I'll have to check; it's on my bookshelf at work.
First edition.
Yeah the first edition wasn't so good. It got quite a big re-write for the second edition which came out quite quickly (in terms of a C book getting a second edition anyway).
why ?
It's hard to put my finger on exactly what it is I don't like about it. After rereading the table of contents I certainly don't disagree with some things (gdb, valgrind, version control, package management, are all good things).

I think my biggest beef is it seems to approach C as if it is a general purpose language, and I would argue that in the 21st century C is no longer a general purpose language. It is at its best now when used for systems programming, embedded programming, and making portable libraries (and the last is also no longer the exclusive domain of C, as besides C++ there are a couple other languages that can export C abi compatible functions and have unobtrusive runtimes).

Also, Klemens seems to like autotools. I don't hate autotools as much as others, as I remember a world before autotools was ubiquitous and it truly sucked. However, the combination of compilers not sucking like they used to (if you are using C99, you have a lot more features than you did on some crappy PCC derived vendor supplied compiler, even if you stick only to pure C99, and the odds of your compiler not "just working" on the C99 code is pretty slim) means that for simple projects a makefile that respects the CFLAGS, LDFLAGS, CC &c. is sufficient; for larger programs, there are serious alternatives to autotools. Obviously none of them are as dominant as autotools, but cmake is certainly prevalent enough to be a good place to recommend people start at.

I'm going to date myself here, but my first book was "Learning to Program in C" by Plum. It was an incredible beginners guide to C, but predates C89, so is a bit too dated at this point to recommend to people.

The same author also wrote "Reliable Data Structures in C" and I would love to update it for at least the features in C99 (C structs became a lot more useful at that point), as that book is a great read in that it walks you through the reasoning for doing things in a certain way, as well as providing the final result in code.