Live data from Hacker News

32 years on, K&R's "The C Programming Language" still stands alone

reprog.wordpress.com

11–20 of 70 posts

Re: 32 years on, K&R's "The C Programming Language" still stands alone

#11
This is one of the few books I've kept on my bookshelf for many years and still read through it every so often for a C syntax refresher. It's a great read since C syntax and conventions are still so pervasive in many of today's languages. Perhaps, it is one of the few programming books that can be passed down from one generation to the next.

Re: 32 years on, K&R's "The C Programming Language" still stands alone

#12
post #9

There is, essentially, nothing to be known about C beyond what is in this book. If you can read those 272 pages, and understand them all, then you are well on the way to being a C wizard. Say what? This is like saying that once you know what all the commands in Illustrator do, you're well on your way to being a professional illustrator. The reason that K&R is so small is that so much of C programming happens outside/…

@tptacek and others on this thread, what books do you suggest to learn modern C programing? I am an experienced programmer, but all of my experience has been with JVM languages. I would like to be able to read and debug C/C++ programs - so which books provide a good start on idioms, libraries and tools?

Re: 32 years on, K&R's "The C Programming Language" still stands alone

#13
post #8
post #4

Earlier quoted context omitted.

The nontrivial differences are more interesting. To make declarations look similar to use was a gigantic mistake. http://cdecl.org/

How is it a mistake? In C, if you know how to use it, you know how to declare it, and if you know how to declare it, you know how to use it. I don't see how one can make even a remotely plausible case that doing it otherwise would be an improvement.

  char * (*(** foo[][8])())[]

  declare foo as array of array 8 of pointer to pointer to function returning pointer to array of pointer to char
Which do you prefer reading?

Re: 32 years on, K&R's "The C Programming Language" still stands alone

#14
post #10
post #7

The thing that has always struck me about K&R is that it contains no fluff. You get so much information for each paragraph, that you often have to re-read them to get all the information contained therein. Probably the programming book I've used the most. In contrast, the C++ programming language is a mouthful, and ended up being just another pretty book on my bookshelf.

Stroustrop is, or at least in its later editions became, a pretty indespensable C++ book. Most of the topics in C++ are best addressed by it. Unfortunately, C++ is a nightmare of a language, so there are many, many topics, and you don't read it cover-to-cover any more than a cook would read New Pro Chef or McGee cover-to-cover.

The copy of Stroustrop's book I have has all of the program text in a proportional, italic font. It was murder on the eyes.

Re: 32 years on, K&R's "The C Programming Language" still stands alone

#17
post #9

There is, essentially, nothing to be known about C beyond what is in this book. If you can read those 272 pages, and understand them all, then you are well on the way to being a C wizard. Say what? This is like saying that once you know what all the commands in Illustrator do, you're well on your way to being a professional illustrator. The reason that K&R is so small is that so much of C programming happens outside/…

@tptacek and others on this thread, what books do you suggest to learn modern C programing? I am an experienced programmer, but all of my experience has been with JVM languages. I would like to be able to read and debug C/C++ programs - so which books provide a good start on idioms, libraries and tools?

_C Interfaces and Implementations_ by David Hanson.

I'm using it as the textbook for a weekend C class I'm about to run for a bunch of Ruby/Java programmers, because CII basically gives you back all the data structures you have in Ruby that C "takes away" from you.

It'll also teach you a style of C development (ADT-centric, modular, heavy on function pointers) that holds up pretty well and is relatively modern.

Re: 32 years on, K&R's "The C Programming Language" still stands alone

#18
post #13
post #8

Earlier quoted context omitted.

How is it a mistake? In C, if you know how to use it, you know how to declare it, and if you know how to declare it, you know how to use it. I don't see how one can make even a remotely plausible case that doing it otherwise would be an improvement.

char * (*(** foo[][8])())[] declare foo as array of array 8 of pointer to pointer to function returning pointer to array of pointer to char Which do you prefer reading?

Why would you write code like this?

Re: 32 years on, K&R's "The C Programming Language" still stands alone

#19
post #9

There is, essentially, nothing to be known about C beyond what is in this book. If you can read those 272 pages, and understand them all, then you are well on the way to being a C wizard. Say what? This is like saying that once you know what all the commands in Illustrator do, you're well on your way to being a professional illustrator. The reason that K&R is so small is that so much of C programming happens outside/…

tptacek, I LOLled at your last comment :-)

But I think you're being unfairly selective in your quoting of the original article. _Immediately_ after the part you excerpted, it continues: "(Er, assuming you have the patience to go on to accumulate a decade of experience leading to wisdom, taste, good judgement and technical intuition.)"

Re: 32 years on, K&R's "The C Programming Language" still stands alone

#20
post #18
post #13

Earlier quoted context omitted.

char * (*(** foo[][8])())[] declare foo as array of array 8 of pointer to pointer to function returning pointer to array of pointer to char Which do you prefer reading?

Why would you write code like this?

The point is not that, but that as soon as you make slightly nontrivial declarations it is not readable in one pass.
Post reply on HN