Hexlet's blog

Code Complete: Naming Mistakes to Avoid in Programming I main picture
Code

Below are the most common mistakes programmers make when naming variables and functions in their code. These examples are taken from the projects of Hexlet students. I use JavaScript for demonstration purposes only because it is the most universal language, so the examples have nothing to do with the language being used. These mistakes are found everywhere in equal proportions.

User avatar Kirill Mokevnin
Kirill Mokevnin
14 April 2022
3 Article reading time ~4 minutes Read more
Code Complete: Naming in Programming main picture
Code

What is the most difficult part of being a programmer? Naming variables.

This thought seems to be popular among programmers for a reason; people often struggle with naming. Indeed, how we name our entities (functions/variables/constants/classes/modules) is of great significance because generally, we read code, we don't write it.

User avatar Kirill Mokevnin
Kirill Mokevnin
14 April 2022
1 Article reading time ~3 minutes Read more
Code

It's very easy to make mistakes when you have to handle variables, change them, keep track of them, etc., especially in a loop. A great way to understand what's going on is to use the simplest debugging tool of all — console.log.

User avatar R. D.
R. D.
19 January 2017
1 Article reading time ~1 minute Read more
Suggested learning programs
profession
Development of front-end components for web applications
10 months
from scratch
Start at any time
profession
Layout with the latest CSS standards
5 months
from scratch
under development
Start at any time
profession
new
Developing web applications with Django
10 months
from scratch
under development
Start at any time