TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

5 pointsby pjdorrellalmost 12 years ago

2 comments

mrlycalmost 12 years ago
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.
dansoalmost 12 years ago
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 未加载