📜 ⬆️ ⬇️

Commenting code in Russian

The question to comment or not to comment on the code is quite understandable to me, I try to adhere to the rules:

- the code must document itself.
- comments for the sake of comments are unnecessary and harmful.
- it is necessary to comment something that may cause questions:
In order to identify such places, you should try to look at a piece of code with other people's eyes.
- At the same time, if the project requires strict documentation for some reason,
it is necessary to adhere to the standards of this project, and not some general advice.

But the question in which language to comment on me is not entirely clear.

')
I have never commented on the code in Russian.
When not only Russian-speaking developers are working on the project or maybe they will work, the question will disappear by itself.
But if you know that the project will be developed and supported only by Russian programmers ...

For some reason, many of my colleagues and I have worked with a persistent negative to Russian comments in the code, but there are almost no normal arguments against it.
And this is despite the fact that English itself is far from perfect.

Some arguments are:
- with Russian characters there may be a problem with the encoding,
- suddenly in the future, outsourcing teams will be involved in the project,
- as it is customary to write in English, the code and comments,
- as if crookedly crooked to write not in English

I don't know the arguments against normal ones, the argument for mine is:

- not everyone knows English well and can write quickly and correctly on it, and crooked comments in English are more evil than anything else

The question also concerns, for example, the comit logs mentioned here.

It will be interesting to hear any opinions about this.

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


All Articles