Rob
Member
For my own personal experience, after I'd done a few tutorials I thought I was a coding boss (as I'd managed to make some alterations/additions) and I decided to make a Monster Rancher style game. Every stat for every monster was a global variable. If I ever wanted to change something or add new stats, it was laborious to update. Doing anything in the game meant doing it for every different monster and copy/pasting (which leads to mistakes/oversights of course) and during that project is when I got to learn about arrays (but not enums, so I still had plenty of problems).I've never been in a situation where I've found myself having too many variables... but I've cursed myself for having too many hardcoded magic numbers way too many times. (And let's just say I learned about using arrays to make batch operations on large chunks of data easier way too late - it's easy to get seduced by long lists of say, comprehensible stat names without realizing it'd make more sense to streamline it into an array because you'll do the same few operations on them over and over anyway)
I lol at myself because I had an excel sheet of stats that I worked with but I updated the arrays manually, which leads to more oversights/mistakes and I just know that if I went to make the same game today, I could do in a weekend what would have taken me weeks back then, and the code would be far less prone to mistakes.