Live data from Hacker News

Ask HN: Should I use K&R to learn C?

news.ycombinator.com

1–10 of 70 posts

Re: Ask HN: Should I use K&R to learn C?

#4
There was a very good critique of K&R in Learn C the Hard Way that got taken down because of (IMO) undue backlash.

The gist of it was that K&R ignores the safety problems in C and there is no discussion of the habits/constructs seasoned C programmers have developed to make sure their code is safe. Of course, many of those habits were developed after K&R, but that's why we need revisions and new sources.

In its place, Zed Shaw (the author), updated Learn C the Hard Way to concentrate on using C safely -- it is an awesome way for a newbie to learn C. Even if you don't agree (and want to use K&R), read this alongside it.

http://c.learncodethehardway.org/book/

Re: Ask HN: Should I use K&R to learn C?

#6
I'd strongly advise people to read K&R C as maybe their second or third book and mostly for historical purposes and not because it's particularly great for learning the language. The exercises are quite fun, however.

You will be better served by reading a more recent (C99) and carefully considered book such as K.N. King's C Programming: A Modern Approach.

Re: Ask HN: Should I use K&R to learn C?

#8
K&R is a great book however I feel there are better books these days. My two personal recommendations are C Programming A Modern Approach by K N King (2nd edition) and Programming in C by Kochan.

However the exercises in K&R are excellent so make sure you do them all. Actually the cost of K&R is justified just for the exercises IMHO.

Also get Understanding and Using C Pointers by Richard Reese, it is a must have.

Two other books I very much enjoyed are Head First C and 21st Century C (2nd edition). Head First has some nice "extra" bits like threads and networking in C. 21st Century C explains sensible, modern ways to do things in C and, more importantly, things you should NEVER do in C!

Re: Ask HN: Should I use K&R to learn C?

#9
post #4

There was a very good critique of K&R in Learn C the Hard Way that got taken down because of (IMO) undue backlash. The gist of it was that K&R ignores the safety problems in C and there is no discussion of the habits/constructs seasoned C programmers have developed to make sure their code is safe. Of course, many of those habits were developed after K&R, but that's why we need revisions and new sources. In its place,…

Then maybe it would be a good idea to go ahead and read K&R and then afterwards read Zed's book?

Re: Ask HN: Should I use K&R to learn C?

#10
post #4

There was a very good critique of K&R in Learn C the Hard Way that got taken down because of (IMO) undue backlash. The gist of it was that K&R ignores the safety problems in C and there is no discussion of the habits/constructs seasoned C programmers have developed to make sure their code is safe. Of course, many of those habits were developed after K&R, but that's why we need revisions and new sources. In its place,…

Interesting, last time I asked on various C boards about learning resources, Zed's book got ripped apart.

http://www.iso-9899.info/wiki/Books

Post reply on HN