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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

How to Write and Document Code So That Other Developers Can Understand It

5 点作者 pjdorrell将近 12 年前

2 条评论

mrlyc将近 12 年前
What works for me is to write the code with a target audience in mind. That target audience is someone who learned the language for one term in college and doesn&#x27;t know it all that well. The maintenance programmers have met those criteria, except for one person who didn&#x27;t know the language at all.<p>I write programs in pseudocode first then add the code underneath, keeping the pseudocode as a comment. The code I&#x27;ve written from 1984 to the present day is still quite readable, apart from a parser I wrote in Perl.
danso将近 12 年前
Uh, I&#x27;m sorry...but I can&#x27;t imagine it being fun to look at old code that you&#x27;ve been able to ignore for six months straight, no matter how well it&#x27;s documented.<p>Ad I think the jury&#x27;s out about writing tons of comments in the code. A full test suite is much more useful and asker to maintain
评论 #5872687 未加载