8
That code review where someone called my variable names 'vague' stung but fixed my workflow
I submitted a Python script for a beginner project and a more experienced dev said my variable names like 'data1' and 'temp_result' made the logic impossible to follow without comments. I spent an afternoon renaming everything to descriptive stuff like 'cleaned_user_input' and suddenly my own code made way more sense. Has anyone else had a single piece of feedback that completely changed how you name things?
2 comments
Log in to join the discussion
Log In2 Comments
riley_king164d agoMost Upvoted
Gotta push back a little though - sometimes overly specific names like 'cleaned_user_input' can be just as noisy if you already know what the data is from context. Short names like 'data1' force you to actually look at the function instead of relying on a label that might be misleading later. Calling it 'data1' is lazy for sure but getting obsessed with perfect names isn't always the fix either.
6
sethp264d ago
Lol "data1" and "temp_result" are definitely on the list of variable names that will come back to haunt you. The thing people don't talk about enough is how bad naming actually slows down your own brain when debugging - like you're fighting past your own variable names to figure out what's happening.
5