T
23

A senior dev told me to stop writing comments for things my code should say itself

I always wrote comments like 'this loop filters out inactive users' until a coworker read my pull request and asked why I wasn't just naming the function filterInactiveUsers() instead. At first I thought he was being picky, but after changing my approach I realized the code became way easier to read without the clutter. Now I spend more time on good variable and function names and almost never write inline comments. Has anyone else had to unlearn old habits about commenting?
2 comments

Log in to join the discussion

Log In
2 Comments
west.claire
Seems like a lot of fuss over something that barely matters either way.
7
jesse_burns8
I mean honestly I'm probably the last person who should be weighing in on this, considering I once spent 45 minutes arguing with my roommate about which brand of ketchup was the superior one. Like, I have zero authority here, but I also can't help myself. Maybe it's just me, but I feel like every little thing gets blown up into some huge deal these days, and then everyone's gotta take a side like their life depends on it. But hey, at least when I get all worked up over nonsense, I'm usually just embarrassing myself in my own kitchen, not on the internet for everyone to see. So I guess I'll just keep being the ketchup warrior and let the rest of you argue about what actually matters.
2