14
A code review comment about my variable names made me rewrite a whole project
I showed a small script to a friend who codes for a living, and he said 'I have no idea what x, y, and z are supposed to be.' I was using single letters for everything. I spent last weekend going back and changing them all to clear names like 'user_input' and 'result_count'. It was a pain, but now I can actually read my own work. How do you guys pick good names without making them too long?
3 comments
Log in to join the discussion
Log In3 Comments
miles7210d agoTop Commenter
How long did it take you to fix everything? I did the exact same thing with an old project last month. I opened it up and had no clue what my own code did because everything was just 'a' or 'temp'. Now I try to use names that say what the thing is for, like 'file_list' instead of 'data'. It's boring work but makes such a difference later.
7