← All journal articles

The five most important programming concepts

Five key programming concepts

Whatever programming language you learn, no matter what complex programs you write, you will always be based on the same basic principles. In this article, you'll learn what concepts make up the basics of programming. You don't need to know math or understand computer teams to understand these topics. So if your kids want to learn programming, you can bring the most fundamental topics to them yourself.

1. Variables

A variable is an object that contains information that a programmer needs. Imagine a “Hi, my name is __________” badge. The space where you enter your name is a variable, and the name is its value (or property).

Variables can have many properties: name, type, lifespan, and storage location in memory. When a developer writes a program, he declares variables — “introduces” them to the computer - and sets their properties. After that, he can access variables over and over again, perform operations on them, change values, and so on. Different languages use different variables. However, regardless of whether you are programming on Python, Scratch or JavaScript, it is the interaction with variables that is the essence of a computer program.

2. Conditional constructions

If you look at it, the main task of a programmer is to force the machine to make decisions according to the proposed circumstances. At the same time, it is desirable that the result be no worse than if such work were done by a person. However, if a person can analyze the situation himself, the computer has to manually describe all stages of thinking. The programmer thinks through the chains of necessary actions and tells the computer: IF you see A, then do B, OTHERWISE do B.

For example, you write a program that reminds you to take meter readings on the 10th of every month. The line of reasoning will be as follows:

  1. Check the current date
  2. IF the calendar is on the 10th, then remind me to take readings
  3. OTHERWISE, get back to the first step.

Real programs can include very branched trees of such arguments, which provide for dozens of scenarios. It is very important to consider each condition, because if the computer encounters unforeseen circumstances, the program will stop working.

3. Features

Programmers use functions to work with variables. These are modules that contain a description of an operation or task. These operations can be applied to other program objects, thereby achieving the task.

The functions work like a “black box”: programmers don't have to understand their internal structure to take advantage of the result. They make it incredibly easy to work with code, allowing a couple of commands to add multiple operations to the program. In many ways, it is precisely because of its functions that a computer program is easy to read and disassemble into composite steps.

4. Cycles

As we talked about in an article about the processor, all the magic of computing capabilities lies in the ability to perform billions of operations per second. At the same time, a significant part of these operations can be looped - the processor repeats the same action over and over again until it reaches the condition specified in the program. The programmer can specify the exact number of cycles or specify another condition that must be met in order to proceed to the next step.

When you teach kids programming, you can explain cycles and conditions using room cleaning as an example. Toys are scattered on the floor, the desk is a mess of notebooks and textbooks, and things from the closet are lying on an unfilled bed. How do you teach a robot to clean things up? Let's figure it out on the floor first.

WHILE there is a toy on the floor ->put it in the drawer OTHERWISE go to bed

The robot will repeat this cycle as long as it sees at least one toy on the floor. And then he will move on to the next section, where he will continue to work on the same principle.

WHILE the clothes are on the bed -> put them in the closet OTHERWISE go to the table

We have notebooks and books on our desk. The former should be stacked, and the latter should be placed on a shelf.

WHILE the notebook is on the table -> put it in a stack OTHERWISE WHILE the book is on the table -> put it on the shelf

5. Data types and structures

When we talked about variables, we used a name as an example. But in fact, variables can store a wide variety of data:

  • Numbers (integers, fractional, positive, negative).
  • Boolean values (that is, corresponding to one of two possible options - yes/no, M/F, workday/weekend).
  • Symbols (a-z, 0-9,! , ^, etc.).
  • Sequences of characters (for example, one variable stores names, the other holds surnames).

Since there is no difference for a computer between the name “Sasha” and the sequence of numbers “1742", it needs to specify what data it is talking about each time. This way he won't try to subtract one word from another or write a novel in numbers.

To conveniently handle different data, programmers compose them into so-called structures. These are special structures within which information is organized in a certain way. For example, arrays and lists are series of values; stacks and queues care about the order in which data is stored.

We are not going to delve into the topic of data structures right now. The main thing you need to understand in order to start learning how to program is that developers have many tools for working with different data, and programming courses teach you how to apply them correctly in practice.

You can also read

Courses for kids

Progkids обратная связь

It's easy to sign up for a free class

Already in the first lesson, we'll dive into the basics of development and create a small project that your child will want to brag about.

Submit a request

ok image
Ваша заявка отправлена. Скоро мы свяжемся с Вами
Ошибка при отправке формы