
Learn C the Hard Way: A Clear and Direct Intro To Modern C Programming - shawndumas
http://www.amazon.com/dp/0321884922
======
sivers
Full-view (non-mobile) Amazon link:
[http://www.amazon.com/dp/0321884922](http://www.amazon.com/dp/0321884922)

------
DonGateley
All you need is K&R, honest.

C is a very simple language. I learned it from K&R in the '80s in an office in
a building in a corn field on a back road halfway between Rockford, Il and
Belvidire, Il. I went on to hire and assist eight others in acquiring it and
then employed them to write, along with myself, a successful machine tool
controller of serious sophistication employing a three way tightly coupled Mot
68010 MP system (using bus fault recovery to resolve address collisions) of my
design. Not bragging, really, just being dramatic about what you can
accomplish starting with just K&R.

~~~
rhizome31
Your statement assumes that one already has access to a copy of K&R. For those
who don't, there's no reason not to start with a cheaper, more recent book.

~~~
danieldk
Except that there are so many K&R copies floating around that it's easy to get
a cheap second-hand copy. E.g. my local Amazon (.de) sells copies starting at
15 Euro.

K&R is really the definitive C book.

------
ryanobjc
I find the C backlash to the excesses of C++ fascinating.

On the flip side, I wonder how people deal with 'programming in the large'
with C - other than 'just be really really careful'

~~~
ninjin
> I find the C backlash to the excesses of C++ fascinating.

I whole-heartedly agree. Something that blew my mind back in undergraduate
school was tree.h by Niels Provos, [1] which is a complete key/value-type
agnostic Red-black Tree [2] in a single header file. Just recently when re-
learning C I stumbled upon klib [3] which has a similar take on generic
programming by "abusing" the preprocessor.

If I am allowed to side-track, I found "C The Hard Way" to be a good resource
when re-learning C. I also had a lot of fun with "Expert C Programming",
although it is a bit dated. I highly recommend it once you have a grasp of the
language basics. I have heard good things about "21st Century C", but I am
still wondering what other good resources there are out there.

[1]:
[http://svnweb.freebsd.org/base/head/sys/sys/tree.h?view=mark...](http://svnweb.freebsd.org/base/head/sys/sys/tree.h?view=markup)

[2]:
[http://en.wikipedia.org/wiki/Red%E2%80%93black_tree](http://en.wikipedia.org/wiki/Red%E2%80%93black_tree)

[3]:
[https://github.com/attractivechaos/klib](https://github.com/attractivechaos/klib)

~~~
noselasd
You don't always need preprocessor tricks to generate a special purpose red-
black tree, you can use an intrusive variant like this:
[http://cgit.osmocom.org/libosmocore/tree/include/osmocom/cor...](http://cgit.osmocom.org/libosmocore/tree/include/osmocom/core/linuxrbtree.h).
This works together with the container_of macro:
[http://stackoverflow.com/questions/15832301/understanding-
co...](http://stackoverflow.com/questions/15832301/understanding-container-of-
macro-in-linux-kernel)

In similar spirit, the linked list variant:
[http://cgit.osmocom.org/libosmocore/tree/include/osmocom/cor...](http://cgit.osmocom.org/libosmocore/tree/include/osmocom/core/linuxlist.h),
though the macros in sys/queue.h are also useful for linked lists.

------
shadowmint
For better or worse an alpha copy of the sort of content for the book is here,
for people who might want to find out a bit more about what the
style/content/etc. is like, before getting the final book:

[http://c.learncodethehardway.org/book/](http://c.learncodethehardway.org/book/)

~~~
ProAm
Such a good read, I wish he'd use line numbers in his code syntax blocks. Its
so hard to read and re-reference without them. For those who cant see well it
helps a lot, and most modern IDEs/text editors line number for you as well.

~~~
saraid216
That's odd, since in Learn Python, he pretty specifically goes out of his way
to make sure the student enables line numbers... specifically for these
reasons.

------
ldonley
Always happy to see another Zed Shaw book, especially after seeing how nice
and helpful he is to others on HN. If this is anything like Learn Python the
Hard Way then you should definitely check it out if you are trying to learn C.

~~~
chatmasta
Funny how his timing works...

~~~
lampington
Oh come on, seriously? He's a fantastic coder, a great educator and a decent
guy in what he does. Sure, he's abrasive and runs people up the wrong way. But
let's not read stuff into timing.

------
doktrin
Excellent. There are relatively few books I'm tempted to pick up in paperback,
but this would be on my short list (despite having worked through most of the
material available online ~6 months ago).

------
donatzsky
Slightly OT:

Can anyone recommend something similar for Java (Android specifically)? The
tutorials I have found so far seem to assume I'm either a complete imbecile or
have a CS degree.

------
rquantz
This is exciting. I've been waiting to see how he filled out the later
chapters for a while now, and presumably this means they're done, or at least
will be by May. I want to see that tiny virtual machine get built!

------
lobo_tuerto
Hope he publishes somewhere an .epub version of them (all his books).

------
alexpopescu
I haven't read any of Zed's book and Amazon doesn't have a decent number of
reviews, so I was wondering if someone could provide the shortest "why should
I get this book"

thanks

~~~
cenhyperion
read the version he provides freely online and see if you like it:
[http://c.learncodethehardway.org/book/](http://c.learncodethehardway.org/book/)

I learned to write python (and program) through Learn Python the Hard Way.

------
akulbe
Ordered. Looking forward to this.

