T
18

Went from hating code comments to loving them after one bad debugging session

I used to think commenting my Python code was a waste of time. Then last month I had to fix a script I wrote back in July for a school project in Denver, and I spent 3 hours just figuring out what each block did. Now I leave at least a one line comment every 10 lines or so. Anyone else have a moment that completely changed how you code?
3 comments

Log in to join the discussion

Log In
3 Comments
alicew68
alicew681mo ago
Nah, that's backwards honestly lol. Good code should explain itself with clear variable names and simple structure. Comments get stale faster than milk in the summer, then you're stuck debugging the comments AND the code.
5
derekward
derekward1mo ago
Yeah, my variable names are usually so bad even I don't get my own code, comments or not.
6
hayden709
hayden7091mo ago
I read somewhere that comments are like a love letter to your future self, and man that hit hard after that debugging session. Three hours of confusion could've been a five minute read with some simple notes.
1