June 14, 2026•7 min read

Programming Fundamentals: Four Concepts Behind Every Program

The core of programming is giving instructions: telling the computer to do what you want it to do, in a language that has rules of its own.

Read in Indonesian

Learning to program is not as hard as you imagine. It is not like studying a foreign language where you memorize a huge pile of vocab, and it is certainly not as hard as math with nothing but arithmetic in it. At its core, programming is simple, because all you need is to give instructions: you tell the computer to do something you want. As long as the instructions are clear, the computer will do the work without much protest.

So how do you give those instructions? You write a program. A program is nothing more than a set of instructions written in a programming language. Like any human language, a programming language has its own rules. That is why a few basic concepts come first, before you write anything that runs correctly.

Those basic concepts are:

  • Variable and data type
  • Control structure
  • Function or subprogram
  • Syntax

Let's go through them one at a time, briefly, so the whole picture holds together. Each one gets a full article of its own later.

The complete discussion of each concept lives in its own article, and you will find the link at the end of each section below.

Key takeaways

  • Programming is at heart about giving the computer instructions, and you write those instructions in a programming language with its own rules.
  • Four concepts are mandatory: variable and data type, control structure, function, and syntax.
  • Syntax differs between languages, but the concepts stay the same. Learn one language deeply and moving to another gets much easier.

Variables and Data Types

A variable is the "main character" of a program. Almost every programming language has this one concept. If you are not sure what a variable is, the definition says it is a place to store data under a symbolic name. Put simply, a variable is just a container for data, so you can use that data again when you need it.

Every piece of data in programming has a shape of its own. Because the shapes differ, each one needs a different kind of container. That shape is what we call a data type. Most languages ship with similar standard types that already exist by default.

Some examples of standard types you will meet often:

  • integer: For whole numbers (examples: 1, 2, 90)
  • float: For decimal numbers (examples: 2.5, 3.14, 2.71)
  • string: For letters or words (examples: "a", "ikan", "Inva si kode")
  • byte: For raw data like images and text
  • boolean: For logical data (true or false)
  • array: For a set of variables of the same type

Beyond those standard types, some languages also give you the freedom to build your own types for your own needs. This feature is usually called a custom data type.

If you want the details on declaring, assigning values, and the full range of types, read Variables and Data Types in Programming.

Control Structures: Branching

Next comes branching. Branching is an important part of a control structure, and its job is to make decisions. Every decision rests on something called a boolean condition. Branching always keeps two things together: the condition itself and the decision it produces.

In the real world, it looks something like this:

TEXT
if (it rains today) then (I will just sleep)
      └─ condition            └─ decision

With branching, you tell the computer to run a particular command when the requirement is met. That requirement is what we call a boolean condition. So what is a boolean condition? As mentioned earlier, boolean is a data type. This one is special because it has only two absolute values: true and false.

To get a boolean condition, you need a boolean expression. The term sounds heavy, 😅 but a boolean expression is just a comparison: "greater than", "less than", "equal to". It can also be a logical operation like AND, OR, and NOT.

The symbols you use in most programming languages look like this:

  • >: greater than
  • <: less than
  • >=: greater than or equal to
  • <=: less than or equal to
  • ==: equal to
  • !=: not equal to
  • && or and: logical AND
  • || or or: logical OR
  • ! or not: logical NOT

Usually branching is marked by the keyword if, followed by the command that runs when the condition is indeed true. For a sense of it, look at this Python example:

PYTHON
if (nilai >= 94):
  print("bagus sekali")

Easy to read, right? You do not have to be a professional programmer to grasp what that line means.

The full form, including when if-else fits better than switch-case, is in Conditional Control Structures.

Control Structures: Loops

The next concept, no less important, is looping. Like branching, looping belongs to the control structure family. As the name says, its job is to repeat a command for as long as the condition still holds. You often need repetitive work while writing a program.

Say you are asked to print the numbers 1 through 5. Sure, you can type the code out by hand:

PYTHON
print(1)
print(2)
print(3)
print(4)
print(5)

Five numbers is no problem to type. Now imagine printing up to 1000 numbers, and your fingers curl. With a loop, you skip the long code. The computer handles that repetition easily and extremely fast.

Loops are usually marked by the keyword for or while. Look at this for loop in Python that prints the numbers 1 through 999:

PYTHON
for number in range(1, 1000):
  print(number)

See? Much simpler, and far easier to read.

Three different loop types, and when each one earns its place, are in Loop Control Structures.

Functions or Subprograms

Next, functions, also called subprograms. A function is the most effective way to break a big problem into small pieces, so the problem gets easier to solve. Functions also let the code you write be reused in many places, which keeps your code tidier and more efficient.

You may have met the word function back in math class. Something like this:

f(x)=x2+x+1f(x)=x^2+x+1

Interestingly, the idea in programming turns out to be very close. There is one difference: the value you put into a program function is not always a number, but any data type we discussed above.

In Python, the math function above becomes something like this:

PYTHON
def f(x):
  return x*x + x + 1

The variable inside the function parentheses (the letter x above) is usually called a parameter. In practice, a function can take more than one parameter. A function can take many parameters, or need none at all.

Look at another example:

PYTHON
def nama_lengkap(nama_depan, nama_belakang):
  return nama_depan + " " + nama_belakang

That is a simple function with two parameters, whose job is to join a first name and a last name into a full name. Practical, isn't it?

The difference between a function and a procedure, with usage examples, is in Functions and Procedures in Programming.

Syntax

Last, syntax. The earlier concepts exist in every programming language, broadly speaking. Syntax is a different story. Just as in everyday language, syntax is the grammar. Every human language has its own grammar, so every programming language has its own unique syntax rules.

That said, some languages share similar rules. c and c++ are very much like Indonesian and Malay: close enough that you can guess your way through. To see it, look at how these different languages print "Hello World".

In C/C++:

CPP
#include<stdio.h>
int main(){
    printf("Hello World\n");
  return 0;
}

In Python:

PYTHON
print("Hello World")

In Pascal:

PASCAL
program Hello_World;
begin
  writeln('Hello World');
end.

People outside the field often think that "learning to program" means memorizing syntax. That is not entirely wrong, but remember that a programming language is ultimately just a tool for solving problems. Whatever language you use, the thing that matters is that the problem gets solved well! 💡

The rules that make your code acceptable to the computer, complete with examples built to fail on purpose, are in Syntax Rules: One Semicolon Stops a Program.

With so many programming languages in circulation, you do not need to be ambitious and become a polyglot who masters them all at once. Learn one language instead, and understand its basic concepts deeply. A strong foundation makes the move to another language much easier, and much easier to adapt to.

Get better at shipping code.

Join the other developers getting tech updates, tips, and relaxed tutorials in their inbox every week.

Stay in the loop

Tech updates, coding tips, and relaxed insights straight to your inbox every week.

No spam. Unsubscribe anytime.

Read next

See all

For developers who learn by struggling

© 2026 Inva.dev.