The Art of Naming: Seven Useful Tips for Programmers

Tony
5 min readAug 6, 2024
Pic from darkreading

Naming is a fundamental aspect of programming that significantly impacts code quality, readability, maintainability, and collaboration. By following best practices for naming, developers can write more understandable, maintainable, and scalable code.

In this article, we will explore seven tips to help programmers elevate their naming game.

1. As Self-explanatory As Possible

In our daily work, a large number of developers tend to use short variable names rather than meaningful ones. This is mainly due to the influence of the examples in our college textbooks.

People are often influenced by their initial exposure, so the abstract and demonstrative variable naming in textbooks has affected generations of programmers for many years. Although those short, textbook-style variable names may save you a few keystrokes, in reality, they are very, very bad.

This is because the maintenance cost of software far exceeds the development cost. If you don’t choose a better variable name, during code reviews, bug fixing, code refactoring, and maintenance, a confusing variable name could leave you bewildered and may even lead you into traps, causing even greater time costs.

--

--