DEV Community

Discussion on: What's the worst advice you've ever received?

Collapse
 
damcosset profile image
Damien Cosset

One guy I use to work with constantly told me to choose shorter variables names, even if it was clear there were harder to understand afterwards. It would go to extreme length to cut a variable name a few characters to make it more readable. Thanks, I hate it now... I guess comprehension is subjective, but as a junior, choosing long and very clear variable names were helping me a lot. To him, it was a distraction.

And also, never learn X because Y... I'll never understand the concept behind telling someone to never learn something. There are always different perspectives, concepts, paradigms to be learned. It might click for someone in a different language or framework, so I've always got a bit sad when I was told never to learn something...

Collapse
 
derekjhopper profile image
Derek Hopper

I like to say we write code for the future reader (could be you, could be him, could be someone else). We should judge readability based on the future reader and not the person reading it today.

Using a shorter name might be more readable today, but completely unreadable in the future.