All coding concepts in 10 minutes

All coding concepts in 10 minutes

Published on Sep 17, 2025

#tutorial

Watch the video version of this article (in Spanish).

You started learning to code with a 16 hours video that makes you yawn every 10 minutes, and you are not learning anything? It is because they are doing it wrong.

When you’re a baby, you first learn to speak, and then you learn the language. In programming, it’s the same. You first learn to program, and then you learn a language.

I’m going to teach you the basic concepts of programming. After reading this, you will be able to learn any programming language easily. Let’s start!

Instructions

Coding is basically giving instructions to a computer.

When you build a Lego, you go instruction by instruction, placing the pieces in the right order, to achieve a goal. In programming, you do the same, but instead of building a Lego, you build a program, instruction by instruction.

In some languages, an instruction ends with a semicolon, in others it’s a single line, etc.

For example, in JS:

instruction;
instruction;
instruction;

Or in Python:

instruction
instruction
instruction

Code blocks

Code is normally grouped in code blocks. These code blocks group a set of instructions. Normally, they are delimited by curly braces {}, or in python, by indentation.

{
	// Code block
}

Code block’s scope

Everything declared inside a code block is only available inside that block, or inner blocks. For example:

outsideVar = 10;

{
	insideVar = 20;

	// Inside this code block, `insideVar` is available because it's inside the block, and `outsideVar` is also available because it's declared outside the block
}

// Outside of the code block, `outsideVar` is available, but `insideVar` is not because it's declared inside the block

These will be more useful when we talk about conditionals and loops.

Variables

Variables are like boxes that contain data. They hold data that can be used later.

There are two steps for using a variable:

Declaration

Declaration is like creating a box. Let’s call our variable name.

Declaration of a variable represented in boxes

Assignment

Assignment is like putting something inside the box. For example, let’s put Pol inside the box.

Assignment of a variable represented in boxes

Primitive Types

A variable must meet a specific type of primitive data. Depending on the language, they can vary, but commonly they are:

  • Numbers: They are numbers. Example: 10 or 20.5.
  • Strings (Text): They normally are between quotes. Example: "Hello".
  • Booleans (True/False): They are true or false. This is like binary data, where 1 is true and 0 is false.

Arithmetic operators

You can use operators to perform arithmetic operations on variables and primitives. You can also save the result of the operation in a variable.

Summation (+)

You can add up numbers using the + operator.

number1 = 10
number2 = 20

result = number1 + number2 # 30

You can also add up strings.

string1 = "Hello"
string2 = "World"

result = string1 + " " + string2 # "HelloWorld"

Subtraction (-)

You can subtract two numbers from each other using the - operator.

number1 = 10
number2 = 20

result = number1 - number2 # -10

Multiplication (*)

You can multiply two numbers using the * operator.

number1 = 10
number2 = 20

result = number1 * number2 # 200

Division (/)

You can divide two numbers using the / operator.

number1 = 10
number2 = 20

result = number1 / number2 # 0.5

Modulus (%)

You can get the modulus of two numbers using the % operator.

number1 = 10
number2 = 20

result = number1 % number2 # 10

Comparison operators

Aside from the arithmetic operators, there are also comparison operators. These operators return a boolean value, which will be really useful for the next section.

Equal to (==)

You can check if two values are equal using the == operator.

10 == 20 # false
20 == 10 # false
10 == 10 # true

Not equal to (!=)

You can check if two values are not equal using the != operator.

10 != 20 # true
20 != 10 # true
10 != 10 # false

Greater than (>)

You can check if a value is greater than another using the > operator.

10 > 20 # false
20 > 10 # true
10 > 10 # false

Less than (<)

You can check if a value is less than another using the < operator.

10 < 20 # true
20 < 10 # false
10 < 10 # false

Greater than or equal to (>=)

You can check if a value is greater than or equal to another using the >= operator.

10 >= 20 # false
20 >= 10 # true
10 >= 10 # true

Less than or equal to (<=)

You can check if a value is less than or equal to another using the <= operator.

10 <= 20 # true
20 <= 10 # false
10 <= 10 # true

Conditional code blocks

How would you tell someone to bring an umbrella if it’s raining? You could say “If it’s raining, bring an umbrella, else don’t bring an umbrella”. This is exactly how conditional code blocks work.

In code we have 2 really important keywords: if and else.

  • if: This keyword is used to check if a condition is true.
  • else: This keyword is used to execute a code block if the condition is false.

You would use them with something like this:

isRaining = true

if isRaining {
  bring umbrella
}
else {
  dont bring umbrella
}

You can even combine if and else with else if to do multiple checks:

temperature = 20

if temperature > 30 {
  bring hat
}
else if temperature > 20 {
  bring sunglasses
}
else {
  bring jacket
}

In all these cases, the code block after the if or else if will be executed if the condition is true, and the code block after the else will be executed if the condition is false.

If you’re still here, congratulations! It’s already a lot of stuff to take in. The next sections will be a bit more advanced, so take a break if you need to. 😄

Arrays/Lists

Arrays (or lists) are variables that can store many values inside them. Think of them like a shopping list or the days of the week.

Important: Arrays start counting from 0 (though you can think of it as starting from 1 if it’s easier at first).

days = [Monday, Tuesday, Wednesday, Thursday, Friday]

In this list, Monday is at position 1, Tuesday is at position 2, and so on.

You can get each value by asking for its position in the list:

days = [Monday, Tuesday, Wednesday]

first_day = get position 0 from days    # Monday
second_day = get position 1 from days   # Tuesday
third_day = get position 2 from days    # Wednesday

Think of it like asking “What’s the first item in my list?” or “What’s the third day in my list?”

Loops

Loops are used to repeat instructions several times. It’s like telling the computer: “do this 5 times”.

There are two common types:

For loops

For loops repeat a fixed number of times.

for 5 times {
    say hello  # This will say hello 5 times
}

You can also use for loops to go through each item in a list:

days = [Monday, Tuesday, Wednesday]

for each day in days {
    say day  # This will say each day one by one
}

While loops

While loops repeat as long as a condition is true.

count = 0

while count < 3 {
    say "Count is: " count
    count = count + 1  # Don't forget to change the condition, or it will loop forever!
}

Functions

A function is a set of instructions that you can reuse. It helps you avoid repeating code and organize it better.

You can think of it like a recipe: you give it a name, some ingredients (parameters), and it gives you back a result.

function add(a, b) {
    result = a + b
    give back result
}

# Now you can use this function anywhere:
sum1 = add(5, 3)  # 8
sum2 = add(10, 20)  # 30

Functions are incredibly useful. The more code you write, the more you’ll use them. They help you:

  • Avoid writing the same code multiple times
  • Make your code easier to read and understand
  • Fix bugs in one place instead of many

For example, instead of writing the addition operation every time you need it, you can just use the add function.

Conclusion

If you’ve made it this far, you already know more about programming than 90% of people who quit after watching a boring 10-hour video.

You now understand the fundamental concepts that every programmer uses every day:

  • Instructions and how computers follow them
  • Variables to store data
  • Operators to manipulate that data
  • Conditionals to make decisions
  • Arrays to store multiple values
  • Loops to repeat actions
  • Functions to organize and reuse code

These concepts work the same way in every programming language. Whether you choose Python, JavaScript, Java, or any other language, you’ll use these same ideas.

The next step? Start building something real with these concepts. Pick a simple project, choose a programming language, and start coding. Don’t worry about making it perfect – just start. Every professional programmer started exactly where you are now.

Remember: programming is not about memorizing syntax or watching endless tutorials. It’s about solving problems step by step, just like you’ve learned here. Now go build something amazing! 🚀