tags:

views:

214

answers:

6

I doubt I'll ever become an expert C programmer, but I decided to check out the K&R book to sharpen my skills and see what supposedly one of the best programming language books is like. I requested a copy of the second edition through my library, but the first edition was loaned to me.

Is the first edition good to learn from?

Are there significant differences between the editions?

Should I insist on getting the second edition?

+3  A: 

Is the first edition good to learn from?

If you're an historian.

Are there significant differences between the editions?

Yes. (The language changed and the book reflects that.)

Should I insist on getting the second edition?

IMO yes.

sbi
+12  A: 

The first edition is heavily outdated, with notable amount of obsolete material, at the same time lacking a considerable amount of up-to-date material.

The second edition is essentially a completely different book. If you are planning to learn the language (as opposed to reading the book just to appreciate it for its historical value), using the first edition is strongly discouraged, since it will most likely only become a source of annoying bad habits.

AndreyT
+6  A: 

The first edition is a very interesting historic relic. It gives a real insight into how the C language was first defined, and gives a useful snapshot of what was the best practice of the time.

However, the second edition was heavily overhauled to deal with the standardised ANSI C language. This made some significant and important changes to C, such as the introduction of void *, the more modern form of function prototyping and the standard C library. If you're going to write in C, a good, clear understanding of the ANSI-standardised language, including the standard library, is essential, and with just K&R first edition you will not get that.

Personally, I find referring to the actual standard to be essential, but I wouldn't wish that on a newcomer. :-)

Tim
+3  A: 

And another book which makes a great reference (while still containing a fair amount of discourse):

Be sure to get the 5th (latest) edition. I hate when libraries assume all editions are interchangeable. I've even gotten different volumes of a multiset work than the one I asked for!

Don Wakefield
fvu
Michael Burr
I made sure to explicitly request the second edition. No use. Next time I'm there I'll file a claim. ;)
Doomie
A: 

The first edition is not bad, but like everyone else is saying, it contains some outdated concepts. That being said, you still can learn the basics of C from it.

Loadmaster
+1  A: 

Insist on the second edition. If nothing else, you must know about function prototypes.

Norman Ramsey