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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Put your pride aside and comment your code for good

1 点作者 felipelalli将近 3 年前

1 comment

frogulis将近 3 年前
Not sure about that. The reason I personally only write comments occasionally is that the code changes and the more comments there are, the less likely they&#x27;ll be maintained along with the code.<p>If I&#x27;m going to make a comment, it better be worthwhile. A heuristic I find useful is &quot;why, not what&quot;. That is, if the code has an unusual but justified feature, place that justification in a comment.<p>Sounds like the author is waist-deep in a crusty old codebase, but I&#x27;m not sure comments on every line are necessarily the solution.