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.

Eloquent code needs no comment

3 pointsby a12balmost 2 years ago

2 comments

samsquirealmost 2 years ago
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.
KingOfCodersalmost 2 years ago
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 ...).