Live data from Hacker News

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

reprog.wordpress.com

41–50 of 70 posts

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

#42
post #20
post #18

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

If that's what you consider "slightly nontrivial", I never want to see what you would consider a difficult type declaration.

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

#44
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?

The first, for a couple reasons, but that's not relevant. My point was that I see no advantage or even plausible case for having declaration syntax be different from use syntax.

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

#47

How does it compare to C Programming: A Modern Approach, by K.N. King? That was great for learning C. Very readable.

Really, downmodded for politely asking an honest question?

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

#48

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 programmin…

I found Doug Crockford's "Javascript: The Good Parts" to have the same qualities as K&R's C book. Concise, readable and dense, a 'must read' for aspiring Javascript programmers.

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

#49
post #17

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

This looks like tptacek's review on Amazon:

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

#50
This is one of the very few if not only tech books I cherish and would never let go of. I'm not a C guru, I did a lot of C in school, but since then almost none.

I'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.

Post reply on HN