📜 ⬆️ ⬇️

If you want to improve something - start with yourself

Somehow the other day my reflections went into the steppe, “for some reason, so many beginners and not only programmers write the most outspoken bydlokod and don't even feel it?”. Including me V_v. Actually, my small article is devoted to precisely these reflections.

If you figure out what is called bydlokodom? More precisely, what is the mainstream accustomed to mean by this word? As a rule, this is in most cases a “difficult to digest” product, i.e. pieces of source code that need to be analyzed for a very long time before changing something in them and, essentially, these pieces (provided that you know what this piece is doing) are easier to rewrite than fix them to a normal state. Or is there any obvious gross errors that a more experienced programmer simply will not allow. And these errors in their trivialities very often lead to fatal consequences for the application - critical overloads, significant shortcomings or inoperability and incompatibility of different parts of the application among themselves.

Many say that this is wrong, it must be fought with and this is not a true way. And many people are outraged and do not approve of such a process of writing. But all the same it is worth understanding some reasons - why exactly this is happening? In the course of my reflections, I came to some interesting conclusions:

1. Man used to think only about himself.
Yes, oddly enough, our, peculiar to everyone, egoism is one of the first reasons for poor coding of the final product. Such developers, as a rule, are exclusive egoists not only in programming, but also in ordinary life. And, I would even say, rather real life is reflected in their coding style, and not vice versa. The fundamental thing here is not to think about anyone but yourself. Do not leave comments. To write as it is convenient for you, and not in the way that everyone else will understand and readable. Those. writing the most convenient and understandable for themselves and minimally recognized for all others.
')
After all, in fact, very many egoists behave this way. Without thinking about anyone and about anything, they are truly moving toward their star. And even if a million people around will claim that they are on a bad road - the real etoist never believes it, until he realizes that this way is not beneficial for his personal interests.

I even doubt that it can somehow be fixed.

2. Crutches for crutches.
Basically, such a reason arises only when the programmer is forced to stop thinking and start doing. The customer or the boss is pressing on top, the project is on fire, overtime and penalties start, etc. etc. In general, the engineer has time to think only in the smoking room. And that, provided that he smokes. In other cases, emergency work sometimes leads to such elegance in the source code, which is not what to show — it is embarrassing to correct it yourself.

And it turns out the product, mainly based on the phrase "It works - do not touch!". And the main reason, as for me, of such a manifestation of weakness is the fear of being reprimanded, of losing a premium or something else empirical. Yes, we are afraid. We are simply afraid to calmly explain that this task will take more time, because it should be good for us and should remain as good after us both in appearance and in the source code and the internal structure. And instead of this we sculpt "tyap-lyap", if only it worked and could get rid of the annoying customer / PM as soon as possible.

3. Ignorance
On the one hand, this is also the easiest way to get bydlokod, but also the most difficult. And, again, everything depends on the self-organization of a person and his moods. What he calculates when he writes something and what he wants to achieve, with what approach and mood he comes to his task and what he does in the end. Even the banal “how many hours you thought about the correct implementation of the filter” can show how seriously a person approaches his business.

But then the question of ignorance lies precisely in self-improvement through books, articles, materials and experience. Even someone else's experience. If there is a desire, then it is better to revise the dents on other people's rakes and leave thankful signatures on them than to fence your garden out of the same hoes and solemnly walk along them.

Small total

Maybe I’ll get another round of holivar, but ...
The basic rule of good writing:

If you want to fix your code, correct yourself first.

For a start it costs only:
1. Start writing not only for yourself, but for the rest. To comment on the code and assume that someone else will have to figure it out later. It is very good if you can put yourself in someone else’s place and think about how a Hindu will feel in your source code.
2. Stop being afraid of windmills and stop coding for the sake of speed and work. Any task must be solved well, otherwise it is not a solution.
3. Learn, read, improve and never forget that your rake - in fact, was someone before you and more than once.

And most importantly - write so that you are not ashamed to show not only the application, but also its source code ^ _ ^

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


All Articles