- Represents the data accurately
- Is verbose enough but still concise
- Makes sense to you
- Makes sense to any other team members that will come across your code in the future
It’s important that all of these criteria are met if you have any hopes of maintaining the software moving forward.
This struggle of my coworker that day inspired me to write a song about the whole process of naming variables while writing code. The song portrays a developer (myself) trying and trying to write code, but I need help naming variables. With none of my coworkers able to help and getting caught up in meetings, it seems like I can never make any progress! It’s just one of those days…
You can find the song below: