Appreciation post: the librarian in Boise who told me my code was fine, my variable names were the problem
I was stuck on a little dice rolling game for 2 hours last Tuesday and finally asked the librarian at the Boise main branch for help, since she runs the teen coding club there. She looked at my screen for maybe 10 seconds and said "the computer can't read your mind, what does x2 mean?" I had 14 variables named stuff like x2, temp, and thing1, and once I renamed them to playerScore and diceTotal, I found my bug in about a minute. That was the day I stopped thinking I was bad at coding and started thinking I was bad at naming things. What's the worst variable name you've ever caught yourself using?
Bro this hits so close to home. My worst one was naming a variable "data2" in a project where I literally had data, data2, and data3 and then spent an entire weekend confused about why everything was overwriting itself. Renamed them to userInput, savedScore, and gameLevel and the whole thing worked in like 5 minutes. It's crazy how much time you lose just because future you can't remember what past you meant by "temp." My CS teacher always said naming things is like half of programming and I thought she was just being dramatic. She was not being dramatic.