The art of programming?

    I love to read programming articles that don't have a single line of code. Such articles are excellently developed "deep" and often give an occasion to look at long-established things from a different angle. Therefore, at the risk of incurring the wrath of a certain slice of the public on my already stunted karma, I decided to publish this article, in the hope that it would give someone not only food for thought, but also help to take a fresh look at my activities.

    Start


    It so happened that at the current place of work, programmers are left to their own devices. That is, of course, they code for the benefit of the enterprise, but it is completely uncontrolled, up 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 signature of all 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 my specialty and specifically at this place is several years longer than me) is an order of magnitude (without exaggeration) exceeding the number of calls in my software. Moreover, calls are usually more "heavy." The prevalence and complexity of our products is 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. These are mainly musicians and artists of various directions. I often visit them in various environments - from their habitats to shops and cafes.

    At home, such people reign as a rule in a mess of creative disorder - from a paint-stained sofa and battered walls to a terrible kind of household appliances and utensils.

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

    When working on a work, the artist / musician usually begins with this very “south-south-west vector” - with 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, seems very vague. In fairness, we note that this is - the lion's share of the pleasure of creativity - to do how it is done. This, in essence, is an attempt to “express oneself”.

    Creative programmers


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

    Error handling is done as it happens - here we check the returned 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 this kind.

    As a result of such work, a completely unpredictable behavior is obtained. The main trouble of one of our developers is the correction of errors in the new version constantly leads to the appearance of new errors in seemingly debugged modules, and to prevent this without completely rewriting everything and everything is already unrealistic. Accompanying such a product is very difficult - refinement on the most elementary points requires a long meditation on the code in an attempt to understand how to do something so that everything does not crash, and preferably without copy-paste of the existing “creativity”.

    The moral of this fable


    Programming is not an expression of oneself, no matter what the romantically inclined juniors say. Good code is a document that is clearly designed and built according to certain rules. Regrettably for some, a programmer is a robot that, depending on the quality of the instructions embedded in it, with one way or another explains to another robot what these protein masses want from it. There is no place for creativity in programming - 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 the employer's money, 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 well-written TOR, you need to identify a clear understanding of what will happen in the end. If there is a chance that the written will have to be deeply modified - all the better - the tasks of writing software with the likelihood of a strong modification are very exciting and by no means simple.

    Well, in conclusion, Steve McConnell’s phrase - "Write the code as if it would be 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.

    Also popular now: