-2
Used to hate code comments until a senior dev showed me a messy function from 3 years ago
I always thought comments were a waste of time because the code should speak for itself. Then last month a senior dev at work pulled up a function I wrote 3 years ago that had zero comments and was a complete mess. I couldn't even figure out what it did without spending 20 minutes tracing variables. He showed me the same function after he added 5 comments, and it suddenly made sense in under 2 minutes. Has anyone else had that moment where something you ignored suddenly clicked?
3 comments
Log in to join the discussion
Log In3 Comments
wendy_henderson217d ago
Totally disagree, comments just get outdated and lie to you later.
5
jenny_lee7d ago
Oh man, I feel you on this but hear me out. Honestly, the trick is to not treat comments like some permanent truth, you know? I always add a date to my updates so people can see when I wrote it, just like a timestamp on a save file. Ngl, I also try to edit old comments if I find out I was wrong, so the info stays useful. Tbh, it's more about being helpful in the moment than trying to be right forever.
0
bailey.jennifer7d ago
Wait, have you ever gone back and read something you wrote five years ago and just cringed so hard you wanted to delete your whole account? Honestly, I found a comment I left on a guitar forum back in 2018 about that one brand of strings, and I was so confident about it. Ngl, I was dead wrong about the whole thing, but at the time I felt like a genius. Tbh, I think wendy_henderson21 has a point about comments getting outdated, but I guess for me it's more about the journey of learning out loud. Like, my old dumb takes are kinda fun to laugh at now, and at least when I fixed them later, someone got the right info eventually.
3