14
My friend watched me code and said my variable names were like alphabet soup
I was using stuff like 'x' and 'temp1' everywhere, and she got totally lost. Now I try to use names like 'userScore' so it's clear, has anyone else had a simple tip that made your code way easier to read?
3 comments
Log in to join the discussion
Log In3 Comments
rubyshah2mo ago
My old code from college had a variable just called 'data' that did three different jobs. I spent more time remembering what it was than actually writing the program. Naming things well is the cheapest way to save your future self a headache.
8
the_viola2mo ago
I once had a variable called "thing" that did everything...
9
the_max2mo ago
Oh man, I started writing what the variable actually is, like 'totalPrice' instead of just 'sum'.
2