Ask HN: Zed Shaw's critique of K&R
I've read of Zed Shaw's critique of K&R in "Learn C the Hard Way", and I've gathered that he had indeed raised an interesting range of issues, regardless of the backlash.
I've tried tracking that critique down to no avail. A link to Shaw's website that I found wasn't accessible,[0] nor was any archive.org copy of it.[1]
Does anyone happen to have a copy of or a link to it? I'd be interested in reading through it.
(Disclaimer: I'm not interested in refueling a debate, I just would like to read the critique or find out its salient points.)
[0] http://c.learncodethehardway.org/book/krcritique.html
[1] http://web.archive.org/web/*/c.learncodethehardway.org/book/krcritique.html
21 comments
[ 1.4 ms ] story [ 58.9 ms ] threadWhenever I see "Zed Shaw," I steer clear.
Edit: Ah, incorrect. He actually intended it to be a chapter-by-chapter deconstruction but never completed it.
Because if that's it, then it was just two points he was making, 1. Null-terminated char arrays are "defective"/unsafe, and 2. Don't omit curly braces, for which he seems to have received a lot of backlash, even though those are quite valid points. I'm guessing it may have something to do with taking it up against the grandfathers of C and his rather ...hands-on writing style?
Critique 1. isn't actually that controversial, and does have merit[1], and 2. is a stylistic decision, that even John Carmack[2] would agree on.
[1]: https://news.ycombinator.com/item?id=20792938
[2]: See "Spacing" in https://kotaku.com/the-exceptional-beauty-of-doom-3s-source-...
> When you start out programming the first thing you work with is strings, and python made them far too difficult to use for even an experienced programmer like me to use. I mean, if I struggle to use Python's strings then you don't have a chance.
To get away with this kind of attitude, one needs to be much smarter than he is.
Do you agree with him that Python 3 strings are difficult for experienced programmers? Apparently they are difficult for Zed Shaw as I quoted above. And also since they're difficult for him, does that mean that beginners "don't have a chance"? Demonstrably false and arrogant claims like this one, as well as many others in his Python and C books, make him lose all credibility.
While I do find his writing entertaining, I wouldn't recommend it for beginners either. But not because he doesn't know how Python 3 strings work.
Python 3 was a disaster, and while his diatribe against it was questionable, the emotion behind it was not particularly misplaced.
http://gen.lib.rus.ec/search.php?req=Learn+C+the+Hard+Way
A weakness of this essay is it jumbles pedagogical and engineering considerations together for dramatic effect. The defensive code Shaw does not find in K&R is only justified if crashing is both likely and worth the effort to prevent. YAGNI and "let it crash" are alternative engineering approaches.
The strength of Shaw's essay is that the grappling with the absence of defensive programming motivated Learn C the Hard Way to introduce Valgrind and Make right away. And the outrage probably adrenaline fueled Shaw's writing. All the controversy was consistent with Shaw's public image at the time, to boot. But in the end, the essay, like many of the period, lacks nuance. Their fading searchability is probably a sign of Shaw's recognition.
I think Learn C the Hard Way is better for Shaw having written the essay and I think his book is a pretty good introduction to C programming in part because it introduces Make and Valgrind and eschews IDE's. K&R is also good, but it's written with the assumption that the reader is ok learning from material written in a documentary style. That's less common today than four decades ago.