T
13

PSA: Someone told me I was overthinking variables and it kind of stuck with me

I was at this little coding meetup in Austin about 3 months ago, just a small group in a library basement. This older guy named Dave looked over my shoulder at a beginner project I was showing off and said 'why do you have 12 variables for something that needs 3?' He wasn't being mean, just blunt. It hit me because I was so focused on making my code 'readable' that I actually made it messy. He showed me how to combine a bunch of them into a single object and it cleaned up like 40 lines. I keep going back and forth on whether he was right or if sometimes more variables make it easier for total beginners to follow. Has anyone else had a stranger just drop a truth bomb on your code like that?
1 comments

Log in to join the discussion

Log In
1 Comment
theabennett
Truth bomb or nah depends if theyre the ones maintaining it.
1