📜 ⬆️ ⬇️

Program as 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 is arranged. Yes, and it is not given to ordinary inhabitants either. There were some subjects in school or university, there was a terrible blue window of omnipresent Pascal, something else. And so everyone is afraid of the word "programming." Some exquisitely magical cat in a bag from the work of Carroll immediately rises before people's eyes. But this is not the case for a long time. There is no cat. Everything has become much easier. So much so that it becomes scary.

Today, any amateur can come and start writing programs, sometimes without realizing the process itself. By the way, one of these amateurs, now writes these lines. I dare to hope that not everything is so bad with me, that the brains in my head have gained a little bit of form for all the time that I have spent studying this discipline, but still. I want to try to explain the process of creating a part of the program from my point of view. So to say, amateurs from amateur.

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

These are not empty words. In general, I noticed that many of the things that you do while you write the code, terribly resemble the actions you perform in life. For example, how this process is with me.
')
First stage


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

Nothing like? 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 originally prescribed by us? Almost never. Life is not filming a movie, and partly in it its charm.

Second phase


The code is written, now you need to run the project. The compiler should check your work for the most trivial errors. If everything ends successfully, you will see your child in full combat readiness. This is where the fun begins. You need to check how initially you are not a fool. You usually find yourself somewhere a fool always. I pressed something and crashed. All were frightened, stopped and climbed into that terrible place. We carefully review, draw conclusions, rule and check again. Then a new error. And so on. The top of the misunderstanding of what happens is the use of debug. And this is a deeply useful moment. Sometimes it is desirable not to get out of it at all. You understand a lot.

You live yourself living, having planned out the day, and then the very “mistakes” appear: events, surprises, situations that interfere with your plan. And now you’re already late for a meeting, not having breakfast, and in the evening you come home, tired like a dog, and you don’t have time for a movie. Perhaps something can be corrected by calling a taxi and buying a hot dog on the way to the meeting. This is like a mini example. For mistakes during our own life, we can pay for years, constantly including some 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 corrected, you can begin mass testing. Here you will again be tormented with new, this time not such obvious mistakes. However, quite often this stage is simply the successful completion of the past. At the exit, you get the confidence that it works. And it works correctly. The latter, however, may not be confirmed in all cases. But after another careful analysis of the written code, sooner or later, you have to find the reason for this behavior.

This is just the next day, or just some time after you had breakfast, met a man and watched a movie. The logical outcome of your pastime. Breakfast may not be the best, cause unpleasant reactions in the stomach. The meeting failed. The film also does not always like the movie. However, if you did everything right: you made breakfast according to my mother's recipe, was polite and courteous at the meeting, chose a quality film, then the results will be positive. If somewhere something went wrong, it means that you will take into account your mistakes, and next time you will be more attentive. It should be noted one fundamental difference - here time can not be reversed.

When you write a program, you live a small life, and perhaps create a new one. No wonder some programmers are sick of "God's syndrome."

I wrote this post just so that it was. I did not want to prove anything or bring something clever or new to this world. Thoughts on paper, no more.

Programmers, write programs. People live the right life.

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


All Articles