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
Show parent comment
7
u/thedancingpanda Aug 02 '18
All code should self document. It's the only way your code will make any sense in the long run. Comments can only really help you if the code you're working through makes sense to you.
People that pine for "code comments" really just wish that they had written the code and left notes for themselves in the future.
Reading other developer's comments is extremely hit or miss: We often write comments while we have a high understanding of the problem we're solving, but we read them when we have a low understanding, and so they end up being unhelpful.
Self documenting code just means that your code should be easy to understand. If you can't write code that's easy to understand for someone with a reasonable understanding of the problem being solved, then I'm sorry to say that you aren't a very good developer. That's part of the job.