DEV Community

Discussion on: Is Commenting Code that necessary?

Collapse
 
kelvinmai profile image
Kelvin Mai

The rule about commenting is that it's not for you. It's for who you expect to read it. If you expect your team to read it, then it would make sense to only comment confusing pieces of code, like why you would have a 3 level nested for loop (sometimes it's the only way). If however it's intended for someone who doesn't understand the code, like a webpack configuration file for example, then comments on it should be close to documentation.

Collapse
 
aashrithashiva29 profile image
Aashritha Shiva

Right ! Well said :)