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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Rob Pike's 5 Rules of Programming

58 点作者 sirkarthik超过 7 年前

11 条评论

lower超过 7 年前
&gt; Pike&#x27;s rules 1 and 2 restate Tony Hoare&#x27;s famous maxim &quot;Premature optimization is the root of all evil.&quot;<p>That quote is from Knuth, not Hoare.<p><a href="https:&#x2F;&#x2F;shreevatsa.wordpress.com&#x2F;2008&#x2F;05&#x2F;16&#x2F;premature-optimization-is-the-root-of-all-evil&#x2F;" rel="nofollow">https:&#x2F;&#x2F;shreevatsa.wordpress.com&#x2F;2008&#x2F;05&#x2F;16&#x2F;premature-optimi...</a>
评论 #15776367 未加载
jacquesm超过 7 年前
Link change?<p><a href="http:&#x2F;&#x2F;users.ece.utexas.edu&#x2F;~adnan&#x2F;pike.html" rel="nofollow">http:&#x2F;&#x2F;users.ece.utexas.edu&#x2F;~adnan&#x2F;pike.html</a>
评论 #15776478 未加载
评论 #15776428 未加载
mrweasel超过 7 年前
I really like rule 5. It&#x27;s can be extremely hard to get data structures right, but you really notice when you do. I had the chance to redo a project, and the biggest chances was to how data was structured and it made a world of difference.
评论 #15776455 未加载
评论 #15776477 未加载
Tehnix超过 7 年前
These are all well and good, as long as you remember not to blindly live by them (which you&#x27;ll often see people do with advice from authority).<p>&gt; If you&#x27;ve chosen the right data structures and organized things well, the algorithms will almost always be self-evident. Data structures, not algorithms, are central to programming.<p>I&#x27;m not sure what the author wants me to take away from this? Data structures and algorithms should very much both be taken into consideration, although I&#x27;d agree that &quot;it all starts with the choice data structure&quot;.
评论 #15776448 未加载
sirkarthik超过 7 年前
I&#x27;ve witnessed the unfortunate consequences when each of these rules were violated.<p>I&#x27;ve seen kludgy code when Rules 1 and 2 are violated for instance.<p>Employing Fancy algorithms to look good among peers, leaving behind buggy and maintainable code.<p>Rule 5 violation is deceptive. Often one can get it right with right understanding of business use-case.<p>The worst part is not the violation of these rules but the developer&#x27;s chest-thumping with pride for writing seemingly intelligent code :-&#x2F;
1_2__4超过 7 年前
On one hand I love these and consider them good advice. On the ther they’re often used as a weak crutch for poor programming practices, usually by developers who believe any amount of money spent on infrastructure is worth it to avoid the catastrophic consequences of maybe thinking about performance in their code. They’re certain they never want to optimize too early, and they’re certain that every day is too early.
dagw超过 7 年前
Understanding and living by Rule 5 is, in my book, what separates good and great programmers.
评论 #15776524 未加载
herodotus超过 7 年前
Rod Burstall of Edinburgh University said pithily: &quot;Efficiency is the enemy of clarity&quot;
NTDF9超过 7 年前
&quot;Premature optimization is the root of all evil.&quot;<p>Except in an interview ;)
zebraflask超过 7 年前
Sound principles, as usual.
khanjahanzaib27超过 7 年前
That is pretty nice topic.