📜 ⬆️ ⬇️

The art of programming?

I love to read articles about programming, in which there is not a single line of code. Such articles are well developed "in depth" and often give reason to look at long-established things from a different angle. Therefore, at the risk of incurring the anger of a certain slice of the public upon my already stunted karma, I decided to publish this article, in the hope that it will give someone not only food for thought, but also help to take a fresh look at their activities.

Start


It so happened that at the current place of work programmers are left to themselves. That is, of course, they are coded for the benefit of the enterprise, but completely uncontrolled, even to the absence of a banal tester. TK, even for “heavy” programs, rarely exceeds the volume of three A4 sheets (one of which is the signatures of all those involved).

Calls for software problems are sent directly to programmers. Since this all started.

I noticed that the number of calls to my colleague (a person working in the specialty and specifically at this place is several years longer than me) exceeds the number of calls to my software by an order of magnitude (without exaggeration). In this case, calls are usually more "heavy". The prevalence and complexity of our products are about the same.
')
In the process of communication, I became interested in the views of colleagues on programming, after which I looked at the source codes of some programs, and everything fell into place.

Opus on creative personalities


For various personal and business reasons, I communicate with creative people. Basically it is musicians and artists of various directions. I often go with them in various environments - from their habitats to shops and cafes.

As a rule, a creative mess is reigning in such people’s homes — from a paint-spattered sofa and shabby walls to the terrible look of household appliances and dishes.

The actions of such people have a certain vector, but its parameters are not set by floating point numbers, but by the “south-south-west” direction. This applies not only to going to the store (buying something on the list with such people is simply unrealistic), but in general everything, including creativity.

When working on a work, the artist / musician usually begins with this very “vector south-south-west” - from a certain mood, concept (born inside or issued by the customer, this is not so important in this case). The end result, in most cases, is very dim. In fairness, we note that this is the lion's share of the pleasure of creativity — how to do it. This, in essence, is an attempt to "express oneself."

Creative programmers


We return to the conversation about programmers. During the conversation, it turned out that some colleagues, not without pride, speak of themselves as representatives of the “creative profession”. At the same time, they really use a creative approach (“vector south-south-west”) with an almost complete set of attributes. As a result, modules appear completely eccentric connectivity, classes with a hierarchy “I will make such a figure here”, methods magically divided into “interesting” (well developed, with precise error handling - such as encryption and network protocol implementation) and “uninteresting” (kilometer listings data export, with a bunch of copy-paste).

Error handling is done as it will - here we check the return values, and in the next file we have exception handling mechanisms. We use smart pointers here, we work directly there. And a bunch of other things of that kind.

As a result of such work, a completely unpredictable product is obtained. The main problem of one of our developers is that the correction of errors in the new version constantly leads to the appearance of new errors in already seemingly debugged modules, and preventing this without completely rewriting everything and everything is unrealistic. Accompanying such a product is very difficult - revision on the most elementary points requires lengthy meditation on the code in an attempt to understand how to do things so that everything does not collapse, and preferably without copying existing “creativity”.

Moral of this fable


Programming is not an expression of oneself, no matter what the romantically-minded juniors claim. A good code is a document that is clearly drawn up and built according to certain rules. Sadly for some, a programmer is a robot, which, depending on the quality of the instructions embedded in it, explains to another robot with one or another efficiency what the protein masses want from it. In programming, there is no place for creativity - starting from naming files and variables and ending with patterns, everything is subject to clear logic and has maximum efficiency. As a result, for this efficiency, the programmer receives not only money from the employer, but also peace of mind when accompanying the product and a sense of control over the situation in case of problems with the program.

Even if the programmer is not given a competently composed TK - you need to designate a clear understanding of what will happen in the end. If there is a possibility that the written will have to be deeply modified - so much the better - the tasks of writing software with the probability of a strong modification are very exciting and not at all simple.

Well, in conclusion, the phrase of Steve McConnell - "Write the code as if accompanied by a violent psychopath who knows where you live." A psychopath is likely to be very angry if he breaks his head from a lack of logic and orderliness.

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


All Articles