News for hackers. Stuff that matters.
Re:Ask HN: Learning C by mahmud on Sunday April 26, 2009 @05:17PM (#580455)
Best beginner text after K&R is Kelly and Pohl's "A Book on C"; very newbie friendly and at the same time uses traditional C examples (i.e. memory management, serializing and reading-back record-oriented data stored in structs, file and directory manipulation, string manipulation, etc.)

Most other C books will just treat it as a stepping stone for C++ which is a different beast, and a few awful offenders will stretch it to Java!

To see a few Algorithm implementations in C, there is no better friend than Robert Sedgwich's polyglot tome; it's the applied Knuth volumes that everyone keeps on their desk (quickly swapped for the actual Knuth volumes when expecting hacker guests.)

Along with C materials you will also need Unix materials. The two are inseparable and fuel each other. You already have a decent Unix in your Mac, and your FreeBSD is the best of the Unix breed bearing the original blood. For that there are no better companions than the books by Richard Stevens, both for system and network programming.

For larger scale software engineering you will need a few small to mid projects of your own. You will deal with header file and Make dependency problems, a few unix and processor portability problems and a few other stuff. The solution to those problems along with a fat library of useful routines are found in "C Interfaces and Implementations" by Hanson. It's a literate programming text where source code is interwoven with prose documentation and it's very self evident.

Along with productive C programming you might need to look into the darker side of C and Unix and follow the papers of the hacking underground (yes, HACKING, dispute the terminology all you want, but I think some blackhats deserve the noble noun more than javascript and CSS jockeys.) Unix and C have plenty of Not-TODOs to motivate plenty of caution. Hoglun and McGraw's Exploiting Software is the canonical C-Do-Not text books.

If you want to read library source code, your FreeBSD source code should give you plenty to keep you busy. Start with the sources for the games; I spent an enjoyable summer porting Minix games to DOS and taught me allot. There is also "The Standard Function Library", or SFL, google it, it has the cleanest C sources you ever seen. Highly recommended.

And should you ever want to write a C compiler, like I attempted, here is some advice: implement Oberon instead. Everything you could possibly learn at 1/100th of the headache.

Just the 2 cents of a guy who will only write C code again if there was a gun to his head ;-)

Re:Ask HN: Learning C by jussij on Sunday April 26, 2009 @08:17PM (#580633)
> Best beginner text after K&R is Kelly and Pohl's "A Book on C";

That's the book I used to teach myself C and I though it was just brilliant.

Re:Ask HN: Learning C by FiveFiftyOne on Sunday April 26, 2009 @06:52PM (#580555)
I actually picked up and then put down a good looking book on Unix systems programming either by Stevens, or by someone who worked very closely with him and wrote an updated version. I think I'll scream off to the book store and track it down.
Re:Ask HN: Learning C by mahmud on Sunday April 26, 2009 @07:12PM (#580572)
It's the updated version of APUE done by Rago (the guy who did Unix System V Network Programming; a fairly good book but with a narrow and almost obselete focus; sysv STREAMS -- a very good idea whose time hasn't come.)