32 years on, K&R's "The C Programming Language" still stands alone
41–50 of 70 posts
Re: 32 years on, K&R's "The C Programming Language" still stands alone
#42Earlier quoted context omitted.
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.
Re: 32 years on, K&R's "The C Programming Language" still stands alone
#43It was written in a different era where publishers weren't inflating page counts for sales.
Re: 32 years on, K&R's "The C Programming Language" still stands alone
#44Earlier 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?
If C made us declare foo using the second format you gave, we'd still have to write, e.g., ((foo[12][3])())[7] in the code where we are actually trying to use foo.
Can you look at a declaration in the second format, and compare to where the variable is used, and see quickly if the usage is correct? With the current declaration format, it's easy--because declaration and usage use the same format.
Re: 32 years on, K&R's "The C Programming Language" still stands alone
#45http://www.reddit.com/r/programming/comments/bn8y5/kernighan...
Re: 32 years on, K&R's "The C Programming Language" still stands alone
#46Re: 32 years on, K&R's "The C Programming Language" still stands alone
#47How does it compare to C Programming: A Modern Approach, by K.N. King? That was great for learning C. Very readable.
Had anyone used both? Will I get downmodded for asking another question?
Re: 32 years on, K&R's "The C Programming Language" still stands alone
#48I 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 programmin…
Re: 32 years on, K&R's "The C Programming Language" still stands alone
#49Earlier quoted context omitted.
@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.
http://www.amazon.com/review/RMXKDJNH8UOPU/ref=cm_cr_rdp_per...
Re: 32 years on, K&R's "The C Programming Language" still stands alone
#50I've been wondering when or if I can get this on the iPad. Even though I own the hardcopy, it has seen better days and it's starting to lose it's binding.