Program like a little life

Many people who somehow overlap with specialists in the field of programming, in particular managers, do not always understand how the process of writing a product works. Yes, and this is not given to ordinary people either. There were some subjects in a school or university, there was a terrible blue window of the ubiquitous Pascal, something else. And so everyone is afraid of the word "programming." Some exquisitely magical cat in a bag from Caroll’s work immediately rises before people's eyes. But this has not been so for a long time. There is no cat. Everything has become much easier. So much so that it gets scary.

Today, any amateur can come and start writing programs, sometimes not realizing the process itself. Incidentally, one of such amateurs is now writing these lines. I dare to hope that not everything is so bad with me that the brains in my head took on at least a little shape for all the time that I spent studying this discipline, but still. I want to try to explain the process of creating part of the program from my point of view. So to speak, to amateurs from an amateur.

Sometimes you are amazed at how simple some things are if you take them apart on the shelves. Seriously, there is a feeling that the future from the films Terminator, The Matrix, and other fiction is not so far away. And if you think a little, you can create the impossible without leaving your home. Create a little life.

These are not empty words. In general, I noticed that many of the things that you do while writing a code are terribly reminiscent of the actions that you perform in life. For example, how this process consists of me.

First stage


If the task is quite voluminous, then, it seems to me, it is much more convenient to write some small amount of code first, which in your opinion should work. You can write everything at once, or break it into separate parts. The second option is better, since there will be less problems at the testing stage. But there are times when it is impossible due to the great connectedness of the parts with each other. What is the likelihood that your code will immediately work as it should? If you do not have serious experience and several years of work on a large project behind you - the probability tends to zero.

Doesn’t resemble anything? We always try to build our day according to a certain plan. In the morning - breakfast, in the afternoon - meeting, in the evening - watching a movie. We really believe that our day will pass exactly as we originally intended. Mentally, the day is divided into parts, they can also be connected or not. But how often does the day pass strictly according to the scenario that was originally prescribed by us? Almost never. Life is not shooting a movie, and partly this is its charm.

Second phase


The code is written, now you need to run the project. The compiler should check your work for the most common mistakes. If everything ends successfully, you will see your brainchild in full combat readiness. Here the fun begins. You need to check how much you are not a fool initially. Usually you are always a fool somewhere. I clicked something and an error popped up. Everyone was frightened, froze and climbed into that terrible place. We carefully review, draw conclusions, correct and check again. Then a new mistake. Etc. The top misunderstanding of what happens is using debug. And this is a deeply useful moment. Sometimes it is advisable not to get out of it at all. You understand a lot.

You live, you live, having planned your day, and then those very “mistakes” appear: events, surprises, situations that interfere with your plan. And now you are already late for a meeting without breakfast, and in the evening you come home tired as a dog, and you are no longer up to the movie. Perhaps something can be fixed by calling a taxi and buying a hot dog on the way to the meeting. This is like a mini example. For mistakes in our own lives we can pay for years, constantly including a certain debug, in fact, analyzing our past, in attempts not to step on the same rake in the present.

Third stage


When all the initial errors are fixed, you can begin mass testing. Here again torment awaits you with new, this time not so obvious mistakes. However, often this stage is simply a successful completion of the past. At the exit, you get confidence that it works. And it works correctly. The latter, however, may not be confirmed in all cases. But after the next careful analysis of the written code, sooner or later, you should find the reason for this behavior.

This is just the next day or just some time after you had breakfast, met a person and watched a movie. The logical result of your pastime. Breakfast may not be the best, cause unpleasant reactions in the stomach. The meeting failed. The movie is also not always like. However, if you did everything right: prepared breakfast according to your mother’s recipe, was polite and courteous at the meeting, chose a high-quality film, then the results will be positive. If something went wrong somewhere, then you will take into account your mistakes and next time you will be more attentive. One fundamental difference should be noted - here it is no longer possible to turn back the clock.

When you write a program, you live a short life, and perhaps create a new one. It is not for nothing that some programmers suffer from the "syndrome of God."

I wrote this post just so that it was. I didn’t want to prove or bring something smart or new to this world. Thoughts on paper, no more.

Programmers, write programs. People, live the right life.

Also popular now: