Hacker News new | ask | show | jobs
by cremno 4348 days ago
Besides being a terrible book, it also contains many small mistakes. My favorite one is checking the return value of memcpy() for non-NULL.

http://c.learncodethehardway.org/book/ex44.html

2 comments

I've noticed the first sentence is very weird and doesn't make much sense. Also that isn't just a small mistake. But I can't edit my post anymore. I'm sorry.

I originally wanted to write more and point out some other important things. For example, “long long” never gets mentioned! This is not a good book to learn C. I believe it could be an adequate (or even good) one to train already existent C skills, but it isn't even that at the moment.

Okay, it isn't a final version. We have to wait until next year for that, but LCTHW gets too much positive attention for being just another less-than-mediocre tutorial book on the Internet.

Hilarious, I didn't pick that one up since it's in the later chapters I skipped..

The bstring thing and his safer copy function are still my favorites for the irony of it. He's sounds so condescending when he attacks C strings and an old K&R example. And then goes on to show how to do it wrong, without really even solving the problem he's trying to solve. And he keeps repeating the lie about C strings just being nothing but an array of chars.