10
That comment about my variable names stuck with me
Someone on a code review told me my variable names were too vague, like using 'x' and 'temp' everywhere. I switched to descriptive names like 'userInputCount' and it saved me hours of confusion later. Has anyone else had feedback that changed how you write code?
1 comments
Log in to join the discussion
Log In1 Comment
charlie_fisher4516d ago
oh great, another person who went to the school of "make your code read like a novel." i've been using single letter variable names for a decade and my code works fine. the problem isn't vague names, it's people who can't hold two lines of context in their head at once. your 'x' is fine if it's just a loop counter in a 10 line function. 'temp' is perfect for something that genuinely is temporary. plus long names make lines wrap and now you have horizontal scrolling, which is its own nightmare. i'll take a clean 80 character line with 't' over something that looks like a sentence any day.
-1