T
11

Found out 90% of coding tutorials use bad variable names and it bugs me

I was reading through a free Python course on YouTube and noticed almost every example used 'x' or 'data' as variable names. That might be fine for a 2 minute demo, but it sets beginners up for a bad habit when they try real projects. Has anyone else found a tutorial that actually forces good naming from day one?
2 comments

Log in to join the discussion

Log In
2 Comments
skylerw87
skylerw874d ago
Oh man, that drives me crazy too. I've been messing around with some basic coding on the side and caught myself naming everything "temp" because that's what every tutorial did. Found one course that actually made students name variables like "user_age" or "total_price" from the very first lesson and it felt way more natural when I tried building something on my own. It's such a small thing but it really does change how you think about what you're writing lol.
2
miller.eva
Wait, is it really that important though? I've been writing code for like 8 years now and half my projects still have random names like "x123" or "thingy" in them. When you're just trying to figure out if a loop works or why something crashes, who cares what the variable is called? Some of the best spaghetti code I've ever written used single letters everywhere and it still got the job done. Plus, spending time on naming stuff just slows you down when you're learning, especially when you might rewrite the whole thing later anyway. I get that it helps when you're sharing code or coming back to it months later, but for personal projects or quick scripts I honestly think people overhype how much it matters.
3