3 ms·
Shaw mischaracterizes K&R by making anachronistic assumptions about its intended audience and ignoring the context in which it was written. When it was written
by brudgers 14y ago
Shaw mischaracterizes K&R by making anachronistic assumptions about its intended audience and ignoring the context in which it was written.
When it was written, a beginning C programmer was most likely coming from a background in assembly and accessing the computer as a professional in the workplace or a student with substantial privileges. The intended audience was sitting near the cutting edge and was assumed to be sophisticated. Data validation could be left as an exercise for the reader in good conscience.
This audience is distinctly different from those who learned programming typing code from magazines and Shaw's current audience for whom he is simulating that experience.
Editorially, K&R has chosen to remain a slender tome. It has let others create fat cookbooks and "for idiots". Forty years on, Shaw criticizes the Wright Flyer by the criteria of Second World War aviation.
We don't hold K&R on a pedestal because of its pedagogical methods, but because of the power of the language it describes. The C Programming Language was a byproduct of creating a language.
Kernigan and Ritchie were programming. Their book is properly judged by different standards than Shaw's educational project.
None of which is to suggest that Shaw"s project may not achieve a comparable level of esteem
- mr_luc 14y agoHe mentioned that the intended audience was different, and even talks about it a little -- what he objects to is that people learning C are being pointed to it in a way that removes all of that context. Especially, it seems like holding K&C up as a paragon of "style" offends him. That's what he means when he says it should be relegated to 'history.' I'd submit that K&C is the fastest way to learn C if you knew nothing about C, or the best way to acquire the Zen of C, and that for those purposes it's still second to none, and its conciseness is a virtue ... but that Zed might be right about people pointing to it as a paragon of style to newbies who hope to write it professionally someday. In fact, I'm disappointed that Zed let this project drop. Seemed neat.
- diminish 14y agoyou can always read and benefit from an old text without anachronistic mistakes, and any text written today will also be obsoleted quickly. it is usually better reading the masters than the pupils.
- Ingaz 14y ago>> In fact, I'm disappointed that Zed let this project drop. Seemed neat. I suppose it's not very interesting to bash someone good work. I think that most important he said in "An overall critique".
- brudgers 14y agoI think Shaw's current project is much better. In part because it has a more positive agenda and therefore is freer to define itself - its hard to logically justify Learn Python the Hard Way based upon the perception that there are shortcomings with K&R.
- EzGraphs 14y agoShaw mischaracterizes K&R by making anachronistic assumptions about its intended audience and ignoring the context in which it was written. Zed does acknowledge as much but this is worth pointing out. For some reason contextual intent and "intended audience" are missed by programmers (who are typically stereotyped for giving answers that are a technical depth irrelevant to the recipients). With that in mind, I think that describing the intended audience and context (as you and others in the comments have done) is a more valuable exercise. It makes K&R (or other book) accessible and applicable to a new generation. Such posts won't normally get much intention - they lack a certain rebellious and inflammatory flair we know and love so well...
- Groxx 14y agoI don't know that this particular case is so much "contextual intent and intended audience" failure as it is that K&R C is suggested, unilaterally, for anyone learning C. It's the bible, and you can't hand someone a bible and then tell them that page 37 line 23 characters 3 and 4 need to be swapped, or you'll summon Satan. They won't remember it when they read that line, nor after they've passed it, they'll just go ahead and summon Satan because the bible told them to. Multiply by 1000 suggestions to warn someone about C. It's basically impossible to adequately warn people that K&R C is unsafe when exposed to the real world, so it's an unsafe suggestion in the way it's usually suggested.
- zeteo 14y ago> Shaw mischaracterizes K&R by making anachronistic assumptions about its intended audience and ignoring the context in which it was written. [...] Their book is properly judged by different standards than Shaw's educational project. So you're basically conceding the main point: K&R is obsolete and unsuitable for education. I beg to differ. It's still a very good read that stands apart from today's clumsy, overwrought introductory textbooks. It can teach you a lot of tricks that are not easily found elsewhere, and does so at a speed that allows absorbing the whole thing in much less than a semester.
- rhizome 14y agoSo you're basically conceding the main point: K&R is obsolete and unsuitable for education. I disagree. I think OP was just saying that sometimes you might need more than one book, given that the original audience had pre-existing knowledge that tended to fill in the gaps. This might appear to be unsuitability "for education" within a popular marketplace of "Learn X in 24 hours" books, and make no mistake that this is the marketplace that Shaw is going after, so it's really a quibble about the level of expertise of your target market. "Rubes can't learn C from K&R." Yeah, well they never have.
- zeteo 14y agoIf you also look at this metaphor >Shaw criticizes the Wright Flyer by the criteria of Second World War aviation it's pretty clear that the OP considers K&R obsolete and unsuitable for today's needs. It's not just that "sometimes you might need more than one book" - you wouldn't want to put the Wright Flyer in the same formation as a Flying Fortress.
- brudgers 14y agoI said what I said, and I didn't say K&R was obsolete. Obsolescence of The C Programming Language is Shaw's claim. The aviation metaphor was intended to illustrate the anachronism underpinning Shaw's analysis. It is not a simile about technological progress. What has changed is the size of the audience for C language learning materials. Until GNU/Linux, obtaining a C compiler required substantial effort for a typical computer user with AmigaDOS, MacOS, or Windows 3.x and 9600 baud bandwidth. K&R uses examples to illustrate points. It was never intended to teach the art of computer programming. It recognizes that there are better resources for that - though I suppose someday somewhere someone will criticize Knuth for not providing a psuedo-code compiler on his website.
- georgemcbay 14y agoI think he's also not giving enough emphasis to the technical realities of the time. When K&R was written, bytes were EXPENSIVE, tracking the size of a string that had to be longer than 255 characters using anything but end-termination would result in every string wasting precious bytes. Everyone agrees that NULL-terminated C strings are the wrong thing to do now, this is why virtually every modern language (including Go, which is obviously very C-inspired) splits a string into data and length as separate entities (even if this separation is mostly hidden from the language user). But when you only have a handful of thousands of bytes for an entire system, you just have to accept some amount of unsafeness as a practical reality. Should K&R be amended with a warning lest it mislead people working on modern systems? Maybe. But I don't think it is fair to code review it using modern thinking about the expense of different operations and the modern luxury of vast amounts of memory.