DEV Community

Discussion on: Don’t comment your code

Collapse
 
vitormalencar profile image
Vitor Alencar

Really nice article =)

Some times we need to comment on the code to also help some co-workers,
it happens to me so many times when I can't fully refactor some piece of code because some other part of the system ( that I usually don't have full control) would depend on it, on that cases I find it helpful to comment on the code and try to bring awareness on of the problem on the code review.

Collapse
 
nadaelokaily profile image
Nada Elokaily

Yes, you should always keep other people maintaining your code in mind, always refactor your code and write better helpful comments to help them understand the logic fast, just don't waste their time with in valuable documentation

Collapse
 
kaitlyn_mccormick_23b1714 profile image
Kaitlyn McCormick

I agree with Vitor. In some businesses, there are those who access the same code to determine a root cause of an issue and correct it. Sometimes, there are junior engineers who find the complex structure intimidating. I still stand by explain the why, not the how. Yet, in some cases, the complex structure if accessed by another team for the same purposes can make a big difference.