📜 ⬆️ ⬇️

Russian identifiers in the code

It will be about using in the program code the names (classes, variables, methods) in the native language (in my case - in Russian).

Experience has shown that Russian identifiers are ideal for creating an object model and for discussing it with the Customer (for domestic projects).


')
One of the general trends of IT development is the gradual “humanization” of technologies. Each new technology is initially focused on a narrow circle of specific specialists, but gradually adapts to an ever wider circle of users, including different cultures. Take at least the introduction of Cyrillic domains (* .) - even if not all browsers normally support the display of Cyrillic addresses, but the process is on!

Having started programming in the early 90s, I never had any problems due to the fact that the files needed to be called only in Latin letters and no longer than 8 characters, but when in the next version of Windows I realized that there were no more restrictions - I thought: same convenient! Every time, giving the name of a new file, I thought out of habit: what if this file was tried to be opened in a system that does not support the Cyrillic alphabet? But the likelihood of this became less and less, and with time the habit disappeared.

About three years ago, I suddenly discovered that in dotNET identifiers can be called any characters - English or Russian, it does not matter. This follows from the fact that dotNET is oriented to work with unicode. The first thing that came to mind - what problems are fraught with the use of Russian names? Having experimented with “russified” code on different versions of Windows and the dotNET Framework, I did not identify a single problem.

Thus, I came to the conclusion that in dotNET there are no technical problems with the use of Russian identifiers.

Of course, there are cases when the question of using Russian names disappears by itself:


It is clear that having an opportunity does not mean the need to use it.

I started using Russian identifiers in almost all of my projects. And over time, I made the following conclusion for myself: Russian identifiers are ideal for creating an object model , and they do not need anything else in the rest of the code.

Now an example:
Suppose a customer is an educational institution and wants a system of accounting for students, classes, subjects, grades, etc. In a conversation with a customer, you use the words “student”, “subject”, “academic performance” - so why should they be translated into English in the code? ? Create an object model:

image

In VisualStudio we create a class diagram:

image

Such a class diagram can even be shown to the customer while talking to him literally “in the same language” - that is, using the same terms. The customer may even have a feeling that he is well versed in your code :)

At the same time, of course, you should not get carried away and call in the code in Russian initially English-language technical terms like “File”, “Stream”, “Collection”, “WebClient”, etc.

Communicating with colleagues on this topic, I notice that the attitude towards Russian identifiers gradually changes over time. From sharply negative to moderately condescending. Here is my list of reasons why programmers want to write code exclusively in English:


By the way, I recently learned that 1C programmers write the code literally “in Russian” :)

In conclusion, the findings:


Update: Bourgeois, whose tools we use when developing, see the code in their own language just ...

Source: https://habr.com/ru/post/108846/


All Articles