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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Eloquent code needs no comment

3 点作者 a12b将近 2 年前

2 条评论

samsquire将近 2 年前
For me, personally, I can read a sentence in my English more easily than code. Code takes more effort for me to read, especially if it&#x27;s not mine.<p>Don&#x27;t tell me what the code is doing, tell me what you&#x27;re trying to achieve. The goal you&#x27;re trying to achieve. Tell me the problem and the outcome you want. Then I should read the code with a target understanding in mind rather than starting from nothing.<p>My mental model of how things work might be different to yours and you need to transfer that mental model to me so I can understand your code.<p>Context is everything when reading a line of code. Context of the business, context of state of the program, context of variables. Context of microservice state. Context context context.
KingOfCoders将近 2 年前
Every code needs comments. Not the WHAT (Here we add a and b - I can read the code!) but the HOW (We use Quicksearch here) and the WHY (We do X instead of Y because ABC or feature X1 or ...).