Earlier quoted context omitted.
Nothing is more enjoyable than watching idiots like you imagine that the world is a fully formed perfect thing that can't possibly be a work in-progress. I watch you guys never put anything out there for fear that someone will think it's just not quite perfect enough. Meanwhile, I crap things into my toilet better than anything you'll make mostly because I put stuff up while I'm working on it so I get immediate feedb…
Zed, I admire you immensely. Please don't feed the trolls.
Learn C The Hard Way
21–30 of 69 posts
Re: Learn C The Hard Way
#22Hmm, I've always viewed K&R as kind of a paragon of C perfection -- I first learned C from K&R when I was 16 or so and have used it as a trusty companion to systems C programming all the way through grad school. Not only do I view it as a good book to learn C, I also view it as one of the best computer science textbooks ever written, partially because it manages to encompass so much of the C and UNIX style along with…
Your question is addressed by the author at the end of the book: http://c.learncodethehardway.org/book/learn-c-the-hard-waych...
I'll admit that I don't think I've ever used K&R C code verbatim[1] so I never saw how outdated all the stylistic code was. I would never recommend this primitive style in modern projects. Thanks for your insight Zed!
[1] Really, if you start dealing with the complexities of C at all K&R will no longer do it. First you'll need to read the ANSI C specification to understand what's supposed to be going on, then you'll need to read your compiler's documentation to figure out how they have actually done what the specification says they should do.
Re: Learn C The Hard Way
#23Hmm, I've always viewed K&R as kind of a paragon of C perfection -- I first learned C from K&R when I was 16 or so and have used it as a trusty companion to systems C programming all the way through grad school. Not only do I view it as a good book to learn C, I also view it as one of the best computer science textbooks ever written, partially because it manages to encompass so much of the C and UNIX style along with…
Your question is addressed by the author at the end of the book: http://c.learncodethehardway.org/book/learn-c-the-hard-waych...
Some may consider the points well taken, not surprisingly K&R had the foresight to respond in kind, two decades earlier:
Our aim is to show the essential elements of the language in real programs, but without getting bogged down in details, rules, and exceptions.
Re: Learn C The Hard Way
#24Earlier quoted context omitted.
K&R isn't available as an E-Book, it is expensive and as someone who has no knowledge about how C is developed and has advanced the age of the book makes me doubt if it is suitable to learn how people develop C programs nowadays. I don't want to finish it and find out that a third of what I learned is outdated.
I have some pretty serious issues with the content in LCTHW, and I would say that reading this book is absolutely not going to give you a deep understanding of how modern c programming is done. K&R is an excellent reference, and LCTHW covers some new topics like valgrind, which is great. However, it fails to point out that some of the exercises are just that; exercises. For example, creating a custom type system in C…
Re: Learn C The Hard Way
#25Hmm, I've always viewed K&R as kind of a paragon of C perfection -- I first learned C from K&R when I was 16 or so and have used it as a trusty companion to systems C programming all the way through grad school. Not only do I view it as a good book to learn C, I also view it as one of the best computer science textbooks ever written, partially because it manages to encompass so much of the C and UNIX style along with…
Your question is addressed by the author at the end of the book: http://c.learncodethehardway.org/book/learn-c-the-hard-waych...
while (...)
if (...) {
...
}
if (...)
...;
"A quick glance makes it seem like this while-loop will loop both if-statements, but it doesn't."How could you possibly conclude that, considering the indentation?
Re: Learn C The Hard Way
#26Earlier quoted context omitted.
Your question is addressed by the author at the end of the book: http://c.learncodethehardway.org/book/learn-c-the-hard-waych...
He brings no pedagogical issues to bare, it's simply a facile critique of "style", I don't think that answers the question why not K&R at all. Some may consider the points well taken, not surprisingly K&R had the foresight to respond in kind, two decades earlier: Our aim is to show the essential elements of the language in real programs, but without getting bogged down in details, rules, and exceptions.
Re: Learn C The Hard Way
#27Earlier quoted context omitted.
Your question is addressed by the author at the end of the book: http://c.learncodethehardway.org/book/learn-c-the-hard-waych...
Of course the completed portion only includes two examples and they are both stupid. ;) while (...) if (...) { ... } if (...) ...; "A quick glance makes it seem like this while-loop will loop both if-statements, but it doesn't." How could you possibly conclude that, considering the indentation?
Re: Learn C The Hard Way
#28Earlier quoted context omitted.
Your question is addressed by the author at the end of the book: http://c.learncodethehardway.org/book/learn-c-the-hard-waych...
He brings no pedagogical issues to bare, it's simply a facile critique of "style", I don't think that answers the question why not K&R at all. Some may consider the points well taken, not surprisingly K&R had the foresight to respond in kind, two decades earlier: Our aim is to show the essential elements of the language in real programs, but without getting bogged down in details, rules, and exceptions.
Re: Learn C The Hard Way
#29Earlier quoted context omitted.
K&R isn't available as an E-Book, it is expensive and as someone who has no knowledge about how C is developed and has advanced the age of the book makes me doubt if it is suitable to learn how people develop C programs nowadays. I don't want to finish it and find out that a third of what I learned is outdated.
I have some pretty serious issues with the content in LCTHW, and I would say that reading this book is absolutely not going to give you a deep understanding of how modern c programming is done. K&R is an excellent reference, and LCTHW covers some new topics like valgrind, which is great. However, it fails to point out that some of the exercises are just that; exercises. For example, creating a custom type system in C…
> K&R is an excellent reference, and LCTHW covers some new topics like valgrind, which is great.
Wrong, I already demonstrate that they have an example that is basically strcpy() and I show why it's broken. By the time I'm done with the book I'll have taken apart the entire book and shown that it's the source of most security holes through poor examples.
> However, it fails to point out that some of the exercises are just that; exercises. For example, creating a custom type system in C. Never do this.
Totally wrong. You basically just said that all of gobjects (the foundation of Gnome) should not exist, yet it's a successful object oriented abstraction. You may think that's true, but then you'd be in the vast minority. Without a demonstrated reason why one should never do this, your statement is total bullshit.
> Some other failings include; little attention to testing, no mention of cmake (used in major projects like opencv and clang) or lint(!), criticism of K&R systax (arguably validly so, but industry standard is industry standard).
There's extensive attention to testing, with nearly every exercise having use of valgrind and the inclusion of defensive programming macros not found in most other books PLUS a constant demand to break the code they've just written. In the second half of the book I'll be including the testing suite I use in my own projects:
https://github.com/zedshaw/mongrel2/blob/master/tests/minuni...
This claim is borderline slanderous it's so wrong.
Edit: And cmake is a piece of crap that isn't better than modern make.
> Look there's a lot of good in Learn C the Hard Way. I completely recommend it as a way to learn some C... but don't make the mistake of assuming a new book is better than an old book just because it's new.
Meanwhile, you make the mistake of not questioning the code in K&R when a cursory read finds numerous flaws and buffer overflows. If you feel that people should evaluate all things objectively (I agree!) then do it yourself and actually read K&R again.
And by the way, they updated it several times to remove defects since you probably read it. My copy was only a few years old and I had to update it because they fixed bugs in that copy() function I tear apart (but not enough).
> If you're programming C, read K&R. If you're doing it professionally, you probably also want to read Deep Sea Programming by Peter van der Linden.
I agree, solid recommendations, but I'm going to advocate people read K&R for historical reasons and to practice code review, which is what I'm doing in my book.
Re: Learn C The Hard Way
#30Earlier quoted context omitted.
Zed, I admire you immensely. Please don't feed the trolls.
Agreed. I really love your work Zed. Let haters hate and keep doing what you best do.
Also, it's a pretty fun way to practice my creative writing. :-)