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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Rules for Good Code

4 点作者 c-rack超过 9 年前

2 条评论

ketralnis超过 9 年前
This may suit the author&#x27;s style and that&#x27;s great. But I strongly disagree with several of these. Calling them &quot;rules for good code&quot; just seems like a lot of hubris.<p>&gt; 0. Use Git and Github. I&#x27;m not going to dignify this with a non-zero number. If you aren&#x27;t using git and github.com then you are already making excuses for doing it wrong<p>Okay? I&#x27;m glad you found a tool that works for you, but there are plenty of others. And he&#x27;s not saying &quot;use source control&quot;. He&#x27;s literally saying that no other tool is good enough.<p>&gt; 2. Make it Open Source<p>I don&#x27;t wanna. Doesn&#x27;t make my code bad.<p>&gt; 3. Always Be Making APIs<p>This is extremely web centric. For web specifically there&#x27;s a case to be made here, but he certainly didn&#x27;t make it<p>&gt; 4. Don&#x27;t Document the Code<p>I guess don&#x27;t ever work on a team of more than two then.<p>&gt; 6. Better is the Enemy of the Good [...] Do not optimize your code. Aim for &quot;OK&quot; and then stop<p>That may work for your project, and maybe every project you&#x27;ve worked on. But it won&#x27;t work for an airplane&#x27;s safety systems.<p>&gt; 9. Make Portable Code [...] Your code should run on every box there is<p>Why? Everything else he&#x27;s talking about is very web-centric, so let&#x27;s assume that. Don&#x27;t you control your whole stack from metal to OS then? Why bother making it super portable when you know everything about the system that will be running the code? You have all of the same upsides of programming for a game console. You&#x27;re in one of the few environments where you can use <i>all</i> of your platform&#x27;s features. Use them!<p>&gt; 10. Lie to Your Management [...] When they demand schedules, plannings, designs, and architectures, lie to them<p>I don&#x27;t even know where to start here.
评论 #10263753 未加载
评论 #10266709 未加载
ry_ry超过 9 年前
&quot;0. Use Git and Github<p>I&#x27;m not going to dignify this with a non-zero number. If you aren&#x27;t using git and github.com then you are already making excuses for doing it wrong. It is not about fashion or groupthink. Github (the company) know how to make Good Code, and their tools reflect this.&quot;<p>I stopped reading there, and shed a single tear for all the enormously talented people through history who thought they had made anything even remotely worthwhile pre-github.<p>:,(<p>Github is great, but it&#x27;s not a prerequisite of Good Code for crying out loud. This article is not Good Writing.