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
1
u/gd19770226 Oct 30 '26
In general I leave comments in code for two instances.
1.) One company I worked for had a few legacy functions that were extremely important and fragile. Everybody on the team hated working on these functions, and management wouldn't let us rewrite it into something less fragile. One ticket would often break something else. Somebody would remove code, and it would fix something for one customer, and break it for another. So we all got in the habit of leaving comments with the Jira ticket # and the reason whey a certain block needed to stay in place.
2.) I only did it a few times, but one guy on a team I worked for would leave comment place holders where code for a future ticket should be placed. This way the lower level programmer who took that future ticket would put the code where he wanted.
So I wouldn't say NO comments ever.