The question of what programming is, only at first glance seems simple. Few people understand that the essence of this activity is in solving problems, and not in writing code according to certain rules.
Every day we are faced with dozens of problems that need to be solved. This can be either a task at work or school, or an elementary question of what and how to cook for dinner. But all problems have one thing in common. In order to complete any task, we need to prepare everything we need, and then perform a series of actions in a special order, in a specific setting and with the required set of tools. In this regard, programming is no exception. For him, first of all, a sharp mind and a computer are required. And then, with the help of suitable programming languages, we can give the machine a set of commands and make them execute. Thus, the solution to the problem is an algorithm – a list of alternate actions that must be performed in order to cope with the task at hand.
Let’s take a meal preparation process as an example.
So, a real life situation – we want to fry сhicken in bread crumbs. Let’s mark all the steps that need to be performed. First, we buy food: сhicken, flour, vegetable oil and breading. Then we go to the kitchen (other rooms are not suitable for cooking) and follow all the points of the recipe.
- Take a large knife, because it is inconvenient for small ones to chop a whole chiсken;
- Roll the pickled meat first in flour, then in breading;
- Finally, fry the chiсken.
Our dish is ready! We can assume that the task has been successfully solved.
An example from programming
Having designated the area of development, we proceed to creating an algorithm – a clear sequence of steps that will lead to the solution of the problem.
- writing a small piece of code that creates 2 fields for data entry;
- we write a part of the program that takes the values entered in the fields, and then multiplies them;
- Finally, we write a function that shows the result.
The result is the correct answer on our screen. The problem of multiplying two numbers is solved!
For beginners, it may seem like programming is just writing code in the form of colored text. However, the main essence of the development is different – in solving a specific problem. That is why Steve Jobs said that everyone should learn programming, because it teaches a person to think!