R
24

My code review said my variable names were like alphabet soup...

I was working on a small Python script for a class project and my friend looked at it and said, 'I have no idea what 'x', 'y', and 'z' are supposed to be doing here.' I changed them all to things like 'user_input' and 'total_count' and suddenly my own code made sense a week later. What's the worst variable name you've ever used and then had to fix?
2 comments

Log in to join the discussion

Log In
2 Comments
terry_walker
Honestly I've used 'data' and 'stuff' in the same function, @troy_reed. Tbh sometimes a short name is fine if the scope is tiny.
5
troy_reed
troy_reed23d ago
I once had a function with variables named 'a1', 'a2', and 'temp'. It was a data parser and I came back to it after a month and had to trace through the whole mess again. Now I force myself to write full words, even in quick scripts.
2