The beauty that didn't save the programmer

“For what you were accepted, for what you will be fired,” says the old wisdom. I was called to this plant to audit accounting, information system, code, processes, etc. But they started by saying that they have a bad programmer. Standard, factory, terrible.



The factory created beautiful products. And he himself was handsome. Really beautiful - apparently, the same designers who draw the products participated in the design of the building. There is also beauty and harmony in the workshops. Cleanliness, order, everything in its place. And most importantly, the entire production process is beautifully automated.



Each batch of products is accompanied by a route sheet, which contains all the necessary technological operations, what to get where, where to send it, etc. On a piece of paper - only barcodes, with a minimum of text.



The worker simply takes a batch of parts, picks it up with a scanner - and the system immediately knows that he has started processing. Lots of small size, no more than one shift is processed, so there is no need to split it when reflecting the fact of release or the passage of the operation. The worker, when he has finished processing the entire batch, simply picks up the scanner, and the system knows that the batch is ready and can go to the next person. The system also knows that the parts are stuck between treatments - there is a peak about the end, but there is no peak about the beginning of the next operation.



Beauty and harmony. The dream of any leader. Full transparency - you always know what, where, when. Therefore, the leader conducts the excursion in such a high spirits. He likes the way things work. Nice automation.



I catch a glimpse of the workers talking suspiciously on the phone. When we approach someone, stand and look at a beautiful machine or the nimble work of our hands, the person smiles and works. As soon as we leave, he starts calling someone.



Well, you never know, maybe they are sociable here. Or is the corporate culture like this - you can try it all day long. I have no time - I need to figure out where the skeleton is in the closet. In any case, the accounting department is sitting somewhere and hammering in a wild amount of documents fixing issues, technical operations and the movement of semi-finished products.



We go to the accounting department - no, it's quiet there. They sit and drink tea. On computer screens - yes, of course, the information system - but certainly not the input of issues. Regular accounting work. Move on.



Probably a blockage in the planning dispatch department (PDO). We go there. Well, not that a blockage - just a lot of work. The manager honestly says that the bottleneck at present is the printing of a large number of route sheets - for each batch and order. Taking into account their small size, a lot of paper is obtained - in fact, it takes most of the time of the PDO employees.



So where's the skeleton? It can't be that good. Okay, let's part with the manager, I'm going to talk to the programmer. He knows for sure.



The programmer sits in a cramped closet, talking on the phone, while frantically doing something in the system. I wait a few minutes until I get a hang of it, manage to get to know each other quickly - and again the programmer's phone rings. I'm waiting again. In the next pause, I insert the question "Can I see how your system works?" - and again the call. At the same time, instant messengers of all known colors - green, blue, violet - flash on the programmer's computer.



The programmer, continuing to talk, opens the system and sources to me on a nearby computer. He drives back, opens chats, looks at pictures, quickly drives something into the system.



Having nothing to do, I look at the system. I generate reports - on sales, output, cost, pricing, etc. All reports are beautiful as one. The minimum of available settings - only beautiful switches, such as by region, product group, etc. You click and enjoy the beautiful views - everything is neat, licked, combed.



This is usually not done in corporate systems, for internal use. There, the approach is technologically advanced - there is a certain universal form, and only the request that extracts data changes from report to report. Then the engine turns them as needed, gives the user settings - groupings, filters, sorting, coloring, etc. Like in BI systems, only simpler, without cubes and other beauty. Strange, you need to look at the code.



I look at the code - my feet are in my mouth ... 4-5 thousand lines of code to generate a release report. For comparison - usually 50-100 lines are enough, and they are all query text, the rest is provided by the platform. It's strange, what is he doing here, in these 4-5 thousand lines?



I look at the names of procedures and functions - again some kind of wildness. They are human-readable, and already by the names it is clear - he, damn it, has its own procedure for each unit. One displays data for workshop 1, the second for workshop 2, etc.



No, okay, it happens - the profit declaration will be worse. I unfold the texts, I look. How many differences do we see? One - the request parameter changes. Instead of shop 1 - shop 2.

Sharing a few more modules - the same garbage. Kilotons of code that draw beautiful reports. Although, now the reports no longer seem so pretty. I'm looking forward to lunch. Lunch is sacred.



And there is. At exactly 12-00 the programmer ends the conversation, throws the phone under the monitor, gets up and heads out of the office. I follow him. Fortunately, he is so angry that he is ready to talk.



Well, it turned out. I worked as a programmer at the factory, did not touch anyone. Slowly he helped users, added something, maintained the system and servers, refilled cartridges. Normally.



But then the head of the enterprise went on a business trip abroad - he saw how people live. And people abroad live beautifully.



And he brought the idea of ​​beautiful automation. I asked the programmer, he answered - some kind of nonsense. Weak. The head found contractors, they fit in - why not fit in, then? The key functional requirements are that everyone in the shops should pick scanners, and not work with a computer with their hands, and data on releases, operations and movements appear instantly, following the implementation of real life events.



No sooner said than done. Several months of torment, and the workshops were filled with magic peaks of barcode scanners, like a real hypermarket. The manager was summoned to hand over the work to personally see the beauty of automation. They brought in a large TV, brought out a sign that reflected the life of the workshop in real time.



We passed it with a bang. The worker was picking with a scanner - the result was immediately displayed on the TV. The second peak, the third, the tenth - life began to boil, both in the shop and on the TV. The manager was pleased. I signed the acts, the contractors left.



And the programmer stayed. He tried to tell the manager that what was done was, to put it mildly, not what was needed. That a simple flat table to which barcode readings are added sequentially is not a reflection of the issue. This is just a laboratory work on connecting scanners in keyboard mode - reading data, writing to a table, decrypting a barcode - it was long, composite, with numbers of order, batch, technical operation, nomenclature, etc. sewn inside.



But the leader did not want to listen to this nonsense. It was beautiful in the workshop. You never know what this village nerd is carrying. Left without a rollback, probably - and serves him right.



Well, then hell began, for the programmer. He worked non-stop for several days to ensure at least some functioning of the system. Judge for yourself: earlier, although through one place, with a delay, but the release data arrived where they are needed. There were standard pieces of paper with release numbers, which were dragged from the workshop to the accounting department or PDO, and these numbers were driven into the system, the internal turnover worked, the balances were correct, the cost was considered.



Now there is only a flat table with scanned and decoded barcodes. Well, the horse mechanism for the formation and printing of these barcodes from production plans. Output data simply did not go to those parts of the system where they were needed - neither the management, nor the accounting turnover. A flat table stood nearby and simply accumulated barcode scan data.



At first, the programmer, under pressure from the accounting department, printed on his knee the print of this very flat table - approximately in the form of how handwritten papers from the shop looked before. I printed this table for them once a day, bukhs were driven into the system.



Then, with grief in half, I wrote code that transferred data from the flat table into the normal system credentials. And it seemed it was possible to calm down, but it was not there. The manager again went to some enterprise and learned that beautiful reports can be received from the system.



Previously, as in most factories, reports for the manager were prepared by special people - accountants, economists, financiers, etc. They took data from the system and brought it into a concise, understandable, beautiful form. Now the manager wanted to receive reports directly from the system.



The second circle of hell began. The deadlines, of course, were extremely tight - the programmer was already considered a gimmick sabotaging progress, and no one would let him relax. This is how kilotons of copy-paste code appeared, written in a hurry and on the knee. And dozens of beautiful reports.



The third circle of hell came from where no one expected - from a flat table with barcodes. It looked good as a demonstration stand, but in real work, all design errors quickly got out, both in terms of technology and in the process of use.



To begin with, the performance of writing to the table has decreased terribly. Then the reading speed dropped. Blocks started. We found requests written by the contractor that were executed at each peak of the scanner 1.5 thousand (!) Times. There were places with an endless recursion, which was interrupted at the ten thousandth step by an effort of will, expressed by the comment "// we will restrict for demonstration." Somehow, many users suddenly found the rights to manually edit data, which some did not fail to take advantage of. The control of the sequence of operations performed by the number of the line in the technical map, and not by the number of the technical operation (these are stupidly different columns of the table, and they do not have to coincide), as a result of which people received an informative message “The sequence of operations was broken”. Using paper routing sheets,without fixing the fact of delivery to the shop and control of changes, led to constant scanning failures - changes in data in the system stupidly changed the composition of the barcode, and the printed one was no longer recognized. Etc.



Naturally, the programmer went to the manager with this information, and more than once. Naturally, no one listened to him. Therefore, the programmer entered the most severe time trouble.



On the one hand, it was necessary to ensure the current operation of the system. This was expressed in the constant sitting on the phone and manual editing of data in a flat table - it is banal so that the shop does not stumble. On the other hand, slowly, as long as there was time, I tried to fix it all. The plant worked around the clock, but in the evening and at night they somehow called less, so the programmer used this time to repair the beautiful automation.



However, the negative accumulated by the leader could no longer be contained. They wanted to fire the programmer. Actually, this was one of the reasons for the audit, which I leaned on.



A couple of days later, when the report was ready, I spent two hours convincing them not to fire the programmer. I recommended that he be promoted and finally start listening to what he has to say. Allow time for refactoring and tidying up. We managed to convince them that the programmer should not be kicked out at least today. We agreed to hold several more meetings, incl. - with a programmer. And that was my mistake.



The next day, everyone got together. Executives of all stripes began to list the problems that the programmer couldn't solve. He confidently answered all the questions. As a rule, with the same phrase - “I already did it, I showed you”, to which the questioner fell silent. I, in most cases, confirmed that the programmer was telling the truth.



For more effective argumentation, they took out a computer and began to show on the fly what "the programmer cannot do in any way." We found almost everything "that we lacked so much for normal work." And everything is beautiful enough. At least it works.



By the end of the meeting, no one understood what its purpose was. The programmer, with hope in his eyes, went to his workplace. The leaders also dispersed, leaving a couple of the main ones. I sat and waited for the verdict - hoping, of course, for a second chance for the programmer and following my recommendations ("you have everything you need, you just don't know how to use it").



But the verdict came out differently - "you see, he must be fired." For what?! Of course, because the system is beautiful. But it doesn't work. And the programmer is to blame for this.



PS The programmer was glad that he was fired. He did not leave himself, because he felt responsibility, or even hyperresponsibility for what was happening at the plant. A week later he worked in a new job with a higher salary.



All Articles