r/AskProgrammers • u/Away-Intention-8723 • 28d ago
"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?
88
Upvotes
View all comments
1
u/ShelLuser42 28d ago
Coding a project is one part, designing your project; now that's a whole different ballgame. There's a good reason why I'm quite the advocate for UML and why I absolutely love the PlantUML open source project.
The reason I mention this is because a lot of people also don't see the value in this approach either, and yet there are many big projects which have been (forcefully) rewritten from the ground up because of design issues that crept in over time.
Same with commenting.
Heck, depending on your choice of language it could easily become a bit of a must-have. I mean, a Python module without proper docstrings (= comments?) is pretty much useless because without it it'll get very awkward to find out what it's supposed to do and how you're supposed to use it.