Re:C is 38 years old. K&R V2 is 22 years old. What's the bes...
by jrockway on Friday November 12, 2010 @11:44PM
(#1900311)
The problem with books that use C as their example language is that they don't cover the finer points of C that are going to fuck you in real life. What happens when you strncpy a string that's the same length as n? How should fatal errors be handled? Who is responsible for memory allocation and deallocation?
These are questions you need to know the answer to, but are unrelated to whatever the book is about.
The best way to learn C is to learn some other programming language, and then apply the common sense you learned back to C.
Re:C is 38 years old. K&R V2 is 22 years old. What's the bes...
by Locke1689 on Saturday November 13, 2010 @12:19AM
(#1900374)
No, you won't ever really learn that stuff until you just do it. Reading code is part of writing code so you should read some actual C code in your domain before ever writing code.
http://news.ycombinator.com/item?id=1245464
Past that, the trouble with C books is twofold: (a) do you really need that much book for such a small language? and (b) most of what you'd use C for (systems programming, codec design, bare-metal network programming, etc) is covered in domain-specific books that use... wait for it... C as their example language.