G
25

That one time my lazy variable names came back to haunt me

When I was new to programming (just starting out, you know), I thought short variable names were fine. I used 'a' for age and 'n' for name in a simple form program (big mistake). Later, when I needed to add a new feature, I couldn't tell what each part did. I had to rewrite almost everything from scratch (it was so frustrating). A more experienced friend pointed out how unreadable my code was. That experience taught me to always use clear, descriptive names. Now, even for tiny projects, I take the time to name things properly. It makes a huge difference when you or someone else looks at the code later.
3 comments

Log in to join the discussion

Log In
3 Comments
andrew693
andrew6931mo ago
Ever tried variable archaeology?
2
val_smith
val_smith1mo ago
It's like finding old code in a dusty project... always a weird surprise.
7
holly_hill89
Wait, is that like digging for data that changes over time? Or something else entirely?
1