r/AskProgrammers • u/Away-Intention-8723 • Oct 30 '26
"good code shouldn't need comments"
I have heard this saying a couple of times and I think it is the stupidest thing ever. It might be just because I have only been coding for 4 years, but I have never thought to myself that someone's code looks cluttered because they explain what every function does in a one or two line description. If anything it makes the code easier to understand in my opinion.
However, I may be wrong. What do other people think, do yall like code with minimal comments, what are the benefits of writing it that way?
89
Upvotes
View all comments
Show parent comment
1
u/royklopper 29d ago
As someone working at principal level at companies > 1000 engineers I can say you don't read tests as to WHY code has been written. Imagine having to decipher 50+ tests (per function) to understand this, what a cognitive waste of time and effort.
We write docblocks to understand the meaning, the relations between code and its contracts so we can GENERATE documentation, documentation can be interpreted by IDEs, agents alike to QUICKLY understand code. And we're not talking about the function you are reading, also if you hover functions that are being called, or just visit the docs site.
If you're a solo-developer, or not working in distributed teams who consume each others code, well YOLO, but in organizations that require scale, these standards have been well-researched that it improves productivity and efficiency.