16
Had a junior dev call me out on my variable names and it stung
I was pair programming with a new guy named Marcus last week and he literally asked me what 'x2temp' meant. I've been using garbage variable names for 6 years and never thought twice about it. He pulled up this article about self-documenting code and showed me how my sloppy naming was making my functions harder to debug. Now I spend an extra 10 minutes per script naming things properly and honestly my code makes way more sense. Has anyone else had a newbie teach them something fundamental that made you feel both embarrassed and grateful?
2 comments
Log in to join the discussion
Log In2 Comments
gonzalez.phoenix11d ago
Switching to descriptive camelCase was a game changer for my old messy code.
6
burns.brooke11d ago
Tbh I feel like people get way too hung up on naming conventions when half the code out there is held together by bad comments and duct tape anyway. Yeah it's nice to have clean variables but if your function is so fragile that a slightly vague name breaks it, you've got bigger problems than what you called your temp string. Just feels like another thing for devs to judge each other over instead of actually shipping stuff.
3