Five Fundamental Concepts of Programming Languages
Five Fundamental Concepts of Programming Languages
1. Variables
A variable is a symbolic name or reference to some kind of information. This is similar to how
the term is used in math. For example, if you’re using positive integers, then a + b > a. In this
scenario, a and b are both variables. In computer programming, variables allow code to operate
for any values being represented by variables, but they can be more than just symbolic letters.
Variables can have a number of properties, such as name, type, value, scope, life time, or
location (in a computer’s memory). Different languages call for variables differently, but they all
use the component. You can find more examples here.
Conditional statements are expressions that ask the program to determine if a variable is true or
false (pro tip: these are known as Boolean values). Typically, if a statement is true, the program
should perform one action, and if a statement is false, the program should perform a different
action. Those actions are called conditions. Read on here and here.
An iteration is any time a program repeats a process or sequence. Loops are a common type of
iteration, in which a program performs a certain action for an indefinite number of times until a
new condition is met. These are frequently called “while loops,” because they often express that
“while” a certain condition is true, the program should continue to do a certain action until that
condition is false or a new condition is true. Loops also make it possible for programs to do
something else while a given process is running.
Data types help classify what information a variable can hold and what can be done with it. Data
types include:
Since computer programs can’t tell the difference between data input that reads “1234” and data
input that reads “abcd,” they need to know the data type in order to differentiate between the
two.
Meanwhile, a data structure is also a data type, but one that contains an unlimited number of
named sub-categories. In this way, the program can parse individual data types while still
treating the entire structure as one data type.
5. Functions
Functions are self-contained modules of code that accomplish a particular task. Once a function
is written, it can be called and used repeatedly. They operate like a black box: data goes in, the
function operates on it, and processed data comes out. Functions let you reuse code rather than
constantly rewrite it, and allow you to think about your program as a series of sub-steps.
Functions are also known as routines or subroutines.
Recognizing these five components of a computer language will help you situate yourself when
learning a new language. You’ll be able to pick up new languages faster, and understand how to
manipulate different languages to best produce your program.