T
8

question about code comments slowing me down

I spent 3 hours last night trying to debug a simple loop in my Python project. Turned out the problem was I had so many comments explaining every line that I couldn't see the actual logic errors. Deleting all the extra comments and rewriting just a few key ones fixed it in 10 minutes. Has anyone else found that too many comments actually makes things harder to read?
2 comments

Log in to join the discussion

Log In
2 Comments
rowanellis
rowanellis1mo ago
Wait, so you mean the comments were actually hiding the logic from you (like they were too noisy) or were they just flat-out wrong?
8
jessicaflores
Both honestly. There was this one project where the comments were like paragraphs explaining what the code should do, but the code itself was doing something completely different. Super confusing trying to figure out which was right. And then other times the comments were just saying obvious stuff like "this adds two numbers" when the code was clearly doing some weird optimization stuff that made no sense. Ended up just deleting most of the comments and rewriting the logic from scratch because I couldn't trust either.
2