Over 5+ Essential Concepts Every New Programmer Must Master
If you're brand new to programming, it can all seem a bit overwhelming at first. Not only are there so many different languages and frameworks to pick from, but there's a lot of conflicting advice on what you need to learn. So many internet gurus are saying you need to master data structures and algorithms, SOLID, O notation, and binary trees. All of that is important, but if you haven't mastered the basic skills, then you're going to struggle to make any of that stick.
This publication is a firm believer in working from first principles and understanding from the ground up how everything works. For example, there's no point learning React until you are fluent in JavaScript. There's no point doing machine learning until you understand how an array works. Everything you learn is just built up on top of previous knowledge; it's just how your brain works.
So if you're brand new to programming, these are the more than 5+ things you need to master before moving on to something new.
1. Variables
Now, variables are used in programming to store values that you're going to be using. Say, for example, you're writing a program to calculate someone's age from their date of birth. The date of birth, in this case, is going to be stored as a variable so you can make changes to it without needing to change the code itself.
Variables are also used to make the code clearer to the reader. In this example, we have today's date as a variable to make it clear what this line of code is doing.
# Example of using variables for clarity
todays_date = "2025-08-03"
date_of_birth = "1990-05-15"
2. Data Types
All programming languages have a set number of data types that are supported. These are the types of values that are stored in a variable. Depending on the programming language you are using, a variable's data type might be fixed the moment you create it (or "declare it," to use correct terminology), or in some languages, it can be changed.
Python and JavaScript both let you change the data type of a variable throughout your application. For example, a variable could start off as an integer and later change to a string. Once you get to write bigger and more complicated applications, it becomes a pain as it's often the cause of hard-to-find bugs in your code. This is why commercial applications tend to be written in strongly typed languages such as C# or Java.
3. IF Statements
Unless your application is very basic, it's going to need to do different things depending on what the inputs are. This is where IF statements come in. They allow you to add logic to your application depending on the value of your variable.
Let's carry on with our age example from earlier. Say you want to work out if someone's old enough to watch an 18-rated film. Here you would use an IF statement and check the value of the age variable to see whether they're old enough.
age = 21
if age >= 18:
print("Enjoy the film")
else:
print("Sorry, you are not old enough to watch this film.")
The condition that you put in an if statement needs to return either true
or false
. Most programming languages have the following logical conditions you can use in your code:
- Equals:
==
- Not equals:
!=
- Less than:
<
- Less than or equal to:
<=
- Greater than:
>
- Greater than or equal to:
>=
You can also put multiple conditions together with the logical operators AND
and OR
. In Python, you just use the words AND
and OR
, but in other languages such as JavaScript, then you would often use a double ampersand (&&
) for AND
and a double pipe (||
) for OR
.
Note: If you're using a language which requires double ampersands (&&
) or double pipes (||
), then make sure you actually include two of them. If you only include one of them, you end up doing bitwise operations, which will be covered in another article.
In some languages such as Python, true
and false
are also represented as 1
and 0
. If you have a look at our age calculation, the part in brackets uses the less than operator. What this part of the code is doing is working out if today's month and day is less than the month and day of your date of birth. If it is, the expression is true (or equal to 1), so it subtracts 1 from your age as you haven't had your birthday yet. Otherwise, it is false (which is equal to 0) and doesn't subtract anything.
4. Functions and Procedures
One of the key principles of software development is called the DRY principle, which stands for Don't Repeat Yourself. As your program gets bigger, there are going to be pieces of code that you're going to want to reuse. There might be multiple places you want to calculate someone's age, for example, and you don't want the same piece of code scattered all over your codebase. This is where functions and procedures come in.
There isn't much difference between functions and procedures. Generally, a function takes an input and calculates an output. A procedure, on the other hand, will perform a task but won't necessarily give you an output. The print
statement in Python is an example of a procedure, as it prints text to the screen but doesn't actually give you an output in the code.
To create a function, you need to define it and give it a name. In our case, let's call it calculate_age
. It's important to give your functions and variables good names so they are easy to understand when you're reading your code.
Next, we're going to put in the code we had earlier to calculate the age into our new function and then return the age
variable at the end.
from datetime import date
def calculate_age(birthdate):
today = date.today()
age = today.year - birthdate.year - ((today.month, today.day) < (birthdate.month, birthdate.day))
return age
It's important to note that the variables you're using inside of the function aren't the same as the ones you're using outside a function. So any changes you make to variables inside the function aren't going to make changes to the ones outside. This is known as "pass by value." In other languages such as C#, it's possible to do "pass by reference"; this actually changes the variable that you pass in.
Last, we need to call the new function to calculate the age. Inside our code, we can even turn our print statements into a procedure to make our code a little tidier.
def display_age_message(birthdate):
age = calculate_age(birthdate)
# We use the str() function here to turn our integer into a string
print("The calculated age is: " + str(age))
# Calling the procedure
born = date(1990, 5, 15)
display_age_message(born)
5. Arrays
Arrays are one of the most important data structures in programming. We covered variables earlier, which are used to store one value. Arrays are used to store multiple values. In our age program, instead of having one date of birth, we could have multiple dates of birth.
In an array in most languages, you can add and remove items from your program during the running of your application. In Python, for example, this is done with the append
, pop
, and remove
methods.
6. Loops
Once you have an array of values, you need a way to run your code against each item in the array. This brings us nicely onto loops. There are two main types of loops you need to know about: while
loops and for
loops.
While Loops are used to loop through your code until a condition is no longer true. Maybe you're adding to a variable or waiting for a user to get the correct answer. This is something you would use a while loop for.
For Loops, on the other hand, are specifically used for looping through an array. We can therefore use a loop in our code to loop through our dates of birth array and calculate the age for each of them.
from datetime import date
# (Assuming calculate_age function from before)
def calculate_age(birthdate):
today = date.today()
age = today.year - birthdate.year - ((today.month, today.day) < (birthdate.month, birthdate.day))
return age
# Array of birthdates
dates_of_birth = [
date(1990, 5, 15),
date(2001, 11, 20),
date(1985, 1, 30)
]
# Loop through the array and calculate age for each
for dob in dates_of_birth:
age = calculate_age(dob)
print("Birthdate: " + str(dob) + ", Age: " + str(age))
With these several foundational concepts, you should have enough information to start your first program.
Join the 10xdev Community
Subscribe and get 8+ free PDFs that contain detailed roadmaps with recommended learning periods for each programming language or field, along with links to free resources such as books, YouTube tutorials, and courses with certificates.