17
TIL my code comments were just me lying to my future self
Last Tuesday I was fixing a script I wrote in January. It had comments like "this handles the edge case" and "don't touch this or it breaks." Problem was, I had no idea WHY I wrote them. I spent 4 hours debugging something that could've been solved in 20 minutes if I'd just explained the actual reason instead of being vague.
Turns out I was writing comments to sound smart, not to be useful. My coworker asked me "what does this do?" and I couldn't answer. That was the wake up call.
Anyone else catch themselves doing this? What do you put in comments now that actually helps you later?
1 comments
Log in to join the discussion
Log In1 Comment
wren_thomas167d ago
Vague comments are honestly just future-you getting pranked by past-you, gotta write them like you're explaining to a confused intern lol.
3