📜 ⬆️ ⬇️

One day programmers will destroy this world



1. Story One: A Memory


When I was little and went to elementary school, I had this story. At recess, I was in the classroom with several friends when a flower fell from the shelf itself. To our misfortune, our teacher immediately entered and, without any investigation, accused us of hooliganism. The red pen made entries about bad behavior in the diary, caused by parents. It was so insulting and not clear what forever crashed into my memory. Since then, I often wondered what made the flower fall?

But the most logical explanation is that he himself fell. He just grew, threw out new shoots, developed and increased the mass. Stretched to the sun. One day, the projection of the center of gravity of the flower went beyond the support and he fell over.
')
I do not know why I am writing all this. Perhaps the melancholy came along with autumn and yellow leaves. Sometimes it seems to me that the science of programming is developing so rapidly, moving forward so quickly, creating new technologies so quickly that one day a person cannot control all this.

2. History Two: programmers do not know exactly how their programs work


I remember quite well my first program for which I was paid money. It was a long time ago. In those ancient times, computers as such were not yet in our country. At least they were very rare. A certain commercial organization, and then such organizations were called "cooperative", started its own production of computers.



It was an improved clone of the computer "Specialist" based on the 580th processor. It was supposed to create their own software for this computer. The first stage is writing the BIOS. Well, I did for the BIOS the very first procedure: the test of RAM. The piquancy of the situation was that the computer being produced was so unreliable that for the RAM test procedure it was impossible to use temporary variables in memory, nothing could be stored in this RAM itself until it was tested. Well, this is generally logical, of course. However, how was it possible to write a memory test with just eight-bit battery A and another six eight general-purpose registers B, C, D, E, H and L? At the same time, the test should, on the graphic screen in the upper right corner, write how much memory was tested: 8 Kb, 16 Kb, 24 Kb ... I did this program for a long time, probably two or three days. I wrote, it turned out it seems up to a hundred lines of assembly code, checked and, proud of my work, saved the program on a magnetic tape. I came to pass-show work, and the tape is not readable on the tape recorder. Well, what to do: right there in the office at the working “Specialist” from memory (!), I re-typed all the code, started it, checked it - hurray! works! Got about 30 rubles seems to work. Big money.

In those very distant times, I understood ABSOLUTELY EVERYTHING in my program.

Since then, it so happened, I wrote programs in assembler processors 6502, Z80, x86. Then he fell ill with Forth. Something turned out on FoxPro. Then it's time to C / C ++. They said who would understand MFC, he is generally a top-class specialist. Learned-mastered MFC. Wrote drivers for Windows 2000 / XP / w7 and for Linux. It was necessary to make a website for the company - participated: html, css, js, php. A little more microcontrollers: Atmel, STM32, x86: MMX / SSE. Some more C / C ++: need boost? need QT? well we take boost, we take QT. Yeah ... along the way, somewhere, I’m doing a program for an Android tablet (Java + JNI + cpp) in Eclipse, and I am also building a system on a chip in Altera FPGAs - here is the Verilog language, testbenches and other hardware joys.

And you know what? I am no longer sure that I fully understand how all these systems, programs, and algorithms work. There is no trace of the former confidence. According to my calculations, a year had to and had to study, get acquainted and use up to 2-3 new technologies, programming environments, libraries and languages. At the same time, of course, there is no certainty that you know everything and understand everything. In fact, you understand only the basic principles ...

Moreover, if once, five years ago, I thought that I know, love and understand c ++, now, with the advent of new standards like c ++ 11, c ++ 14/17, I have a really hard time. My colleagues fix my code by replacing my typed variables with the auto type ... So what? Is it possible that after this the code really becomes more readable? Or here is not very fresh news: it is undesirable to use inheritance, but it is preferable to use templates. And I feel sad. I do not like templates.

I would probably be completely discouraged, however, in private conversations with other programmers over a cup of cognac, it suddenly turns out that not only do I have such problems, I am not the only one who is backward (although not everyone admits this right away, it depends on the size of the cup). Many, like me, do not fully understand someone else's code, do not fully understand how our entire system works, do not know which third-party libraries we have already connected and use, do not understand where our 67 streaming program in our not very complex program why it takes in memory of 350 megabytes.

Most of all in this high-level programming story I’m worried about the “magic string effect”. This term I recently invented. This is not about bugs, which of course were, are and will be. It's about one line of code that fundamentally changes the properties of the program.



For example, we write a program using QT libraries. We have our own class inherited from QGraphicsView. We use our class, place QGraphicsScene on it, add all sorts of QGraphicsItem and live happily ever after, but slowly. Then we insert one magic line into the code:

QGLWidget* gl = new QGLWidget(); this->setViewport(gl);

, OpenGL.
— ! ! , OpenGL?
— , .
— . ! !
— ! … - DLL .

. , - - . - QGraphicsVideoItem… - … :

QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);

— ! ! ?
— … , OpenGL DirectX (Angle) : CPU …
— ???????????..
— , , QA..

N1: ! ? ? time-to-market? « », , ?

:


. , . . .



, . -, , . -, , , , .

:


- , , . .

. , , , , . , , - , , , . , , . , , . , - . , , .



: , , — . — .

. , — , . , , .. , , . , — . , 100%, . . . , .

, (!) .

. , , , . .

, . , . . , …

. : , . , , continuous integration, . « ». , . QA , QA, , . , , (feature), .

, , , . — , , — GUI, : , , . , , . , — . .

N2: , .

: , , ? ? - ? , , CAD? ? ? -? . , , …

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


All Articles