O
7

A friend looked at my code and said 'you're naming your variables like a madman'

3 comments

Log in to join the discussion

Log In
3 Comments
thomas.cameron
Totally agree with that. My old code was a mess of single letters and weird abbreviations. Had a file full of things like 'a' and 'b' and 'data2'. Took me forever to figure out my own work a year later. Now I just type out the full name, even if it's long. It saves so much time and headache when you need to fix something.
6
black.mark
black.mark1mo ago
Used to believe short names made me code faster. Then I spent an hour trying to remember what "d3" meant in my own script. Clear names like "dailySalesTotal" take an extra second to type but save me hours later. It feels like leaving a note for my future self. Now I'd rather have a long variable name than that confused feeling all over again.
6
jenniferc71
Ugh, been there. I had a function full of stuff like 'x1' and 'tempVar'. My buddy just stared at it. I forced myself to use names that actually say what the thing is, like 'userInputString' or 'itemCount'. It's annoying to type at first, but six months later when you open that file, you'll actually know what's going on.
4