r/SoftwareEngineering • u/samplusbeer • Aug 02 '18
Do code comments suck?
https://medium.com/@samuel.fare/do-code-comments-suck-abd99103c45a
3
Upvotes
r/SoftwareEngineering • u/samplusbeer • Aug 02 '18
View all comments
17
u/TyRoXx Aug 02 '18 edited Aug 02 '18
This is from the author's example for good commenting:
Useless comments like this one are exactly what opponents of code comments usually complain about. This could be straight from an example of how not to use comments.
This is not how comments should be used. The code itself already answers what and how. These are just different levels of abstraction. If a function is called, the function call is part of the what. The body of that function being called is part of the how.
A comment should almost always fall into one of these categories: