4 ms·
K&R is a incredible book that every programmer should own. I honestly don't see why you would need any other book for C.
by jmcguckin 16y ago
K&R is a incredible book that every programmer should own.
I honestly don't see why you would need any other book for C.
- gte910h 16y agoIt's style isn't correct for modern C is a good reason why.
- spacemanaki 16y agoDo you have any recommendations?
- gte910h 16y agoI'd go with http://www.amazon.com/Reference-Manual-Samuel-P-Harbison/dp/013089592X http://www.amazon.com/Reference-Manual-Samuel-P-Harbison/dp/... (non-aff link) for reference and something like one of these (non-aff links) for learning: http://www.amazon.com/C-Programming-Modern-Approach-2nd/dp/0393979504/ref=sr_1_3?s=books&ie=UTF8&qid=1289637913&sr=1-3 http://www.amazon.com/C-Programming-Modern-Approach-2nd/dp/0... http://www.amazon.com/Study-Guide-Programming-Modern-Approach/dp/0393969460/ref=pd_sim_b_3 http://www.amazon.com/Study-Guide-Programming-Modern-Approac... http://www.amazon.com/Programming-3rd-Stephen-G-Kochan/dp/0672326663/ref=pd_sim_b_2 http://www.amazon.com/Programming-3rd-Stephen-G-Kochan/dp/06... <=Dunno if it covers C99 either, but very basic
- tedunangst 16y agoIn general, categorizing someone's style preference as incorrect rarely leads to anything good. And in this instance, considering how many people still use and prefer the style in question, if you're learning C there's a good chance you'll be working with others on existing code using that particular style.
- gte910h 16y agoWhile you're correct, people dislike being confronted and its often easier to just not bother doing so, they are actually doing it incorrectly at this point if they're writing straight out of K&R 2nd ed. The style of the book is actually in error, as in, will cause compiler errors and subtle bugs in modern systems. They should know enough of what's gone on in the last 20 years of the C world to know K&R's second edition isn't the end all be all of C development. If you insist on writing to C90 (and for many applications, there are very good reasons to do so), you need to restrict yourself to the intersection of valid C90 and valid C99. You need to do this for the same reasons you would be writing C90 today (well, other than you never bothered to learn C99 in the last decade) K&R, 2nd Edition, does not observe this (as that's impossible for it to have done so, as it's so old). People who only read K&R, 2nd Ed, tend to not be cognizant of this most important of practices, which makes integration with their code and modern code a pain. In addition to failing to do this, it uses variable names from an era where terminals were 16x80. It uses increment operators in wholly inappropriate, precedence overeliant conditionals which would get you slapped silly the first time you cause a serious bug/heisenbug up in any C shop. It introduces the bad string functions (K&R is often pointed to people who never learned to not use scanf, etc) without any discussion of why you shouldn't ever think of touching them except in very small edge cases and toy programs, nor does it give examples of how to safely use them if you don't have any substitutes available. Past the actual deficiencies of the text, you still have other issues. At the end of K&R 2ndEd, You know nothing of dealing with characters and languages other than those that fit in ASCII, nothing of using modern threading/multiprocessing/parallelism, nothing of C99 (including why large variable span is bad), nothing of modern object oriented C (which has been in use since systems like X windows used it in the 80s), nothing of standard layouts of projects (or even C source files), nothing of safe string functions, nothing of the differences in variable sizes for different platforms, and in short, nothing of what's happened in 22 years worth of C betterment since this book came out. The 2nd edition of the book was published in 1998. You need more than that to get a handle on the core of C today. The end of 32bit ints and non ASCII languages alone mean the book needs more if you are going to use it. It's not enough on its own. If you find out a guy has learned C from nothing but it, it's a pretty reliable indicator "Nope, nope, no modern C experience" and you better make sure he's re trainable into accommodating how things are done today.
- Locke1689 16y agoNo. You should read K&R and then read the spec.
- deleted 16y ago[deleted]
- jonhendry 16y agoIt appears to be out of print. EDIT: Or maybe not. It's just surprisingly expensive (~$60) and Amazon apparently doesn't stock it themselves.
- xiongchiamiov 16y agoIt's expensive because people keep buying (and keeping) it.