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.
2 comments

Log in to join the discussion

Log In
2 Comments
andrew693
andrew6934d ago
Ever tried variable archaeology?
2
holly_hill89
Wait, is that like digging for data that changes over time? Or something else entirely?
1