TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Zed Shaw's critique of K&R

16 点作者 gilesgate超过 5 年前
I&#x27;ve read of Zed Shaw&#x27;s critique of K&amp;R in &quot;Learn C the Hard Way&quot;, and I&#x27;ve gathered that he had indeed raised an interesting range of issues, regardless of the backlash.<p>I&#x27;ve tried tracking that critique down to no avail. A link to Shaw&#x27;s website that I found wasn&#x27;t accessible,[0] nor was any archive.org copy of it.[1]<p>Does anyone happen to have a copy of or a link to it? I&#x27;d be interested in reading through it.<p>(Disclaimer: I&#x27;m not interested in refueling a debate, I just would like to read the critique or find out its salient points.)<p>[0] http:&#x2F;&#x2F;c.learncodethehardway.org&#x2F;book&#x2F;krcritique.html<p>[1] http:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;*&#x2F;c.learncodethehardway.org&#x2F;book&#x2F;krcritique.html

7 条评论

brudgers超过 5 年前
I can see why Shaw made the article less accessible via search. Shaw has done the same with other essays he wrote around the same time. The basic analysis is sound. If you write programs like those in <i>The C Programming Language</i> those programs will lack mitigations for buffer overflows and null pointers.<p>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&amp;R is only justified if crashing is both likely and worth the effort to prevent. YAGNI and &quot;let it crash&quot; are alternative engineering approaches.<p>The strength of Shaw&#x27;s essay is that the grappling with the absence of defensive programming motivated <i>Learn C the Hard Way</i> to introduce Valgrind and Make right away. And the outrage probably adrenaline fueled Shaw&#x27;s writing. All the controversy was consistent with Shaw&#x27;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&#x27;s recognition.<p>I think <i>Learn C the Hard Way</i> 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&#x27;s. K&amp;R is also good, but it&#x27;s written with the assumption that the reader is ok learning from material written in a documentary style. That&#x27;s less common today than four decades ago.
nenadg超过 5 年前
[0] <a href="https:&#x2F;&#x2F;archive.is&#x2F;7cbe6" rel="nofollow">https:&#x2F;&#x2F;archive.is&#x2F;7cbe6</a>
评论 #20853883 未加载
jdmoreira超过 5 年前
&quot;Learn C the Hard Way&quot; is considered by many to be a horrible book on C
评论 #20853937 未加载
sverona超过 5 年前
I doubt my Google-fu is better than yours (and it looks like Zed has basically retracted what he said anyway by way of going so far to remove it from the Internet) but one of the salient points was definitely &quot;some of the code in the book doesn&#x27;t compile or do what it says it does.&quot;
评论 #20853520 未加载
yesenadam超过 5 年前
Library Genesis has almost everything.<p><a href="http:&#x2F;&#x2F;gen.lib.rus.ec&#x2F;search.php?req=Learn+C+the+Hard+Way" rel="nofollow">http:&#x2F;&#x2F;gen.lib.rus.ec&#x2F;search.php?req=Learn+C+the+Hard+Way</a>
antiquark超过 5 年前
Try google with &quot;PDF&quot; as part of the search term, there seem to be a couple of stragglers on the web.
评论 #20853454 未加载
psv1超过 5 年前
Zed Python3-strings-are-too-difficult-for-me Shaw? I wouldn&#x27;t bother with anything he&#x27;s ever said or written.
评论 #20855017 未加载