Live data from Hacker News

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

reprog.wordpress.com

1–10 of 70 posts

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

#2
Very nice semantics, but hideous syntax. Pascal had it done right with a more linear declaration syntax. C looks like lisp in a bad way if you make slightly nontrivial declarations. Of course to make matters worse somebody went on and made C++, which must be the most hideous language ever to evolve, possibly because its creator borrowed heavily ideas from how his native natural language Danish was formed; It is mostly comprised of guttural sounds and every new groan you make is added to the language. It has been said that C++ is to C what lung cancer is to lung.

Basically we will never get rid of C, for there is just too much piled up on it. C++ though we should replace because it is an atrocity to programming.

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

#3
post #2

Very nice semantics, but hideous syntax. Pascal had it done right with a more linear declaration syntax. C looks like lisp in a bad way if you make slightly nontrivial declarations. Of course to make matters worse somebody went on and made C++, which must be the most hideous language ever to evolve, possibly because its creator borrowed heavily ideas from how his native natural language Danish was formed; It is mostl…

C's syntax is much more terse than Pascal's; whether that makes it better or worse is open to discussion. begin...end or {...}? I would argue that Pascal's syntax is easier to learn, but that C's is easier to use once learned. And since I spend more time using languages than learning them, the latter is more important to me.

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

#4
post #2

Very nice semantics, but hideous syntax. Pascal had it done right with a more linear declaration syntax. C looks like lisp in a bad way if you make slightly nontrivial declarations. Of course to make matters worse somebody went on and made C++, which must be the most hideous language ever to evolve, possibly because its creator borrowed heavily ideas from how his native natural language Danish was formed; It is mostl…

C's syntax is much more terse than Pascal's; whether that makes it better or worse is open to discussion. begin...end or {...} ? I would argue that Pascal's syntax is easier to learn, but that C's is easier to use once learned. And since I spend more time using languages than learning them, the latter is more important to me.

The nontrivial differences are more interesting. To make declarations look similar to use was a gigantic mistake.

http://cdecl.org/

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

#6
I think it says something that K&R C, as a book, is significantly more readable and concise than most programming books nowadays. Part of it is the language, but part of it is simply how the book is approached. Simple statement, simple example, move on.

I mean, compare that book to the other programming books on your shelf. It is positively minuscule. And if you compare the writing to that in a more modern programming book, there's certainly a lot of wasted text in newer books.

My latest programming book is The Essential ActionScript 3.0 by O'Reilly, and there's way too much embellishment in the text. Not only does it make it longer to read, but it also makes it harder to find particular information, and quickly absorb it.

I learned C almost exclusively from K&R C, and I know many others did too, and to this day I wonder how it is that all these new programming language books can be such monolithic texts.

"Essential", they say.

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

#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.

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

#8
post #4

Earlier quoted context omitted.

C's syntax is much more terse than Pascal's; whether that makes it better or worse is open to discussion. begin...end or {...} ? I would argue that Pascal's syntax is easier to learn, but that C's is easier to use once learned. And since I spend more time using languages than learning them, the latter is more important to me.

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.

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

#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/above the language.

I like K&R a lot, and I won't argue that it's the best soup-to-nuts C book (though I recommend C Interfaces and Implementations more heartily). But if everything you need to know about C is in K&R, how do you implement a balanced tree?

(I caught myself typing "how do you implement a hash table", and remembered that K&R actually has a hash table in it. Damn you, K&R!)

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

#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.
Post reply on HN