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.
Hexlet's blog
Code
Kirill Mokevnin
14 April 2022
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.
Kirill Mokevnin
14 April 2022
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
.
Motivation
We are launching our new study program in English. The first course — Programming fundamentals — has started yesterday, new lessons come out every Tuesday and Friday. It's free!
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