💡
2
c/coding-for-beginners•karen361karen361•1mo ago

Coworker told me to stop commenting every line of my code and I fought him on it for a week.

I was writing comments like "this adds 1 to x" for every variable until he showed me my 300-line script was taking him an hour to read through. Has anyone else had to unlearn bad commenting habits?
3 comments

Log in to join the discussion

Log In
3 Comments
linda_dixon49
this adds 1 to x" holy smokes that's brutal, how'd you finally get it?
3
jennifer833
this adds 1 to x" made me laugh because I used to do the exact same thing. What helped me was a senior dev telling me to comment on why I'm doing something, not what it does. Now I only add comments when the code isn't obvious or when I'm making a weird decision that needs explaining.
2
lindag33
lindag331mo agoTop Commenter
Omg I had a friend who did this too, she wrote "this loop goes through the list" on every single for loop. Her senior finally sat her down and made her delete all those comments and write real ones. She said it felt super uncomfortable at first but after a week her code made way more sense to everyone else on the team.
3