I partly agree, clean, self-explanatory code should reduce the need for comments. But comments are still valuable for explaining why a decision was made, business rules, or non-obvious tradeoffs that code alone can't easily convey
Unpopular Opinion: If Your Code Needs Comments, You Wrote It Wrong.
4 Comments
I think the "good code doesn't need comments" argument is often aimed at the wrong target.
Well-written code shouldn't need comments explaining what it does:
# Increment counter by one
counter += 1
That's just duplication.
But comments aren't only for explaining mechanics. They're often the only place we can capture intent.
Code can tell me how something works. It usually can't tell me:
- Why a business rule exists
- Why an apparently strange implementation was chosen
- Which production incident is this code preventing from recurring
- What external requirement or regulation drove the decision
- Which assumptions future maintainers should not casually remove
Years into my career now, the comments I've appreciated most weren't explanations of syntax. They were breadcrumbs left by a previous developer, explaining the problem they were trying to solve and what would break if I "cleaned up" their code.
Future me has thanked past me for good comments far more often than for clever code.
Back in the COBOL/mainframe era, comments were often treated as documentation because the people maintaining the system years later might not even be the same company, let alone the same team. Then the Clean Code movement correctly pushed back against comments that merely translated code into English.
The pendulum swung from:
"Comment everything."
to
"Comment nothing."
The healthier position is:
"Comment decisions, assumptions, constraints, and intent. Let the code explain mechanics."
That's a rule that's held up pretty well across every codebase I've touched.
Please log in to add a comment.
Please log in to comment on this post.
More Posts
- © 2026 Coder Legion
- Feedback / Bug
- Privacy
- About Us
- Contacts
- Premium Subscription
- Terms of Service
- Refund
- Early Builders
More From bilalmlkdev
Related Jobs
- Software Engineer, Test & Infrastructure II (Bilingual Spanish)Vail Systems Β· Full time Β· Springfield, IL
- IOS Developer (iPad, X Code, XMLJSON Parsing) | HybridSamprasoft Β· Full time Β· Sunnyvale, CA
- IOS Developer (Xcode, Swift, Objective-C) | Hybrid - Sunnyvale, CASamprasoft Β· Full time Β· Sunnyvale, CA
Commenters (This Week)
Contribute meaningful comments to climb the leaderboard and earn badges!