What is a program, programming and programming language? - Part 2
This article separates program, programming and programming language, using the grocery billing example to explain how people understand problems, design solutions, write code, test and maintain programs in practice today.
What is a program, programming and programming language? - Part 2
Program, programming and programming language are the three words every beginner hears on the first day, and most of the time they are used as if they mean the same thing. They are related, but they are not the same. When these basics are not clear, it is very hard to understand the topics which are built on top of them like compilers, operating systems or software design. In the previous article, we discussed how a computer solves a real-world problem with the help of Input, Process and Output model and an algorithm. In this article, we are going to see what is a program, what is programming and what is a programming language and how these three are connected with each other.
Understanding Computers and Programming series:
- How computers solve real-world problems? - Part 1
- What is a program, programming and programming language? (this article)
- What are the generations of programming languages? - Part 3
- How computers execute programs? - Part 4
- How programming languages work behind the scenes? - Part 5
TL; DR Summary
- A program is a set of instructions written to perform a specific task on a computer.
- Programming is the complete activity of understanding a problem, designing the solution, writing the code, testing and maintaining it.
- Writing code is only one part of programming.
- A programming language is a formal language with strict rules, used to write instructions for a computer.
- Human languages are ambiguous, programming languages must not be.
- Every programming language has syntax (how to write) and semantics (what it means).
- Computer only understands machine code, so every program written in a programming language must be translated before it runs.
Common Challenges
Human language is ambiguous
We humans are very good in understanding the meaning from the context. If someone says “I saw a man with a telescope”, we will not get confused, but the sentence actually has two meanings, who had the telescope? A computer cannot use the context like us. If we give the instructions in plain English, the computer will not know which meaning we wanted, and it should never guess, otherwise the same program will behave differently at different times.
Computer only understands 0 and 1
Fundamentally, a computer is an electronic machine and it only understands two states, ON and OFF, which we write as 1 and 0. Every instruction, number, letter and picture must be converted into a pattern of 0s and 1s. Writing a program directly in 0s and 1s is possible, the early programmers did exactly that, but it is very slow, very easy to make mistakes and almost impossible for another person to read. We will see this in detail in the next article.
What is a program?
A program is a set of instructions, written in a specific order, which tells a computer how to perform a task.
In simple terms, a program is the algorithm written in a language the computer can follow. The calculator, the web browser and the billing software in our grocery shop are all programs. Some programs are very small, just few lines to add two numbers, and some programs like an operating system have millions of lines.
Example:
The shop bill algorithm from the previous article, written as a small program in C language,
#include <stdio.h>
int main()
{
float price, total = 0;
int qty, count, i;
printf("Number of items: ");
scanf("%d", &count);
for (i = 0; i < count; i++)
{
printf("Price and quantity: ");
scanf("%f %d", &price, &qty);
total = total + (price * qty);
}
if (total > 1000)
total = total - (total * 5 / 100);
printf("Total: %.2f\n", total);
return 0;
}
Don’t worry if you don’t understand every line now. Compare it with the algorithm, you will notice the same steps are there, read the input, multiply and add, apply the discount and print the output. It is the same solution, only the language is changed.
A program which is stored in the disk and not running is just a file. When we run it, the computer loads it into memory and starts executing the instructions one by one, a running program is called as a process. We will see this in detail in Part 4.
What is programming?
Programming is the process of creating a set of instructions that tells a computer how to perform a task.
Simply put, programming is everything we do to turn a problem into a working program. Many beginners think programming means typing the code, but typing the code is only a small part of it. The following diagram depicts the activities involved in programming.

Here are the activities,
- Understand problem - Know what the user really needs. Refer the previous article for how to do it.
- Design algorithm - Plan the step by step solution before writing the code.
- Write code - Convert the algorithm into a program using a programming language.
- Test - Run the program with different inputs and check the output is correct. For our shop, test with zero items, one item, a bill just below 1000 and just above 1000.
- Debug - Find and fix the mistakes, these mistakes are called as bugs.
- Maintain - Change the program when the need is changing, for example, when the shop introduces a new discount rule.
Again, these activities are not done only once. It is a loop, when we test and find a bug, we will go back to design or code, fix it and test again. A person who does programming is called as a programmer or a developer.
What is a programming language?
A programming language is a formal language, with a fixed set of words and rules, used to write instructions which can be translated and executed by a computer.
In simple terms, a programming language is the bridge between a human and a computer. It is close enough to our language so that we can read and write it, and it is strict enough so that it can be converted into the 0s and 1s the computer understands without any confusion.
The following diagram depicts the difference. Without a programming language, the programmer has to write the machine code directly. With a programming language, the programmer writes readable source code like total = price * qty and a translator converts it into machine code. The flow highlighted in purple is the way almost all programs are written today.

Every programming language is defined by two things,
- Syntax - The rules of how to write the instructions, like the grammar of English. In C, every statement must end with a semicolon, otherwise the program will not be translated at all.
- Semantics - The meaning of the instructions, what actually happens when it runs.
total = price * qtymeans multiply price and quantity and store the result in total.
Keep in mind that a program can be correct in syntax and still wrong in semantics. If we write total = price + qty, the translator will be happy, but our customer will get a wrong bill. The translator can catch only the syntax errors, the logical errors must be caught by us during testing.
How these three are connected?
Let us take a closer look at how program, programming and programming language are connected, with a simple analogy. Think about writing a letter,
- Programming language is like the English language, with its words and grammar.
- Programming is like the activity of writing the letter, thinking what to say, writing it, reading it again and correcting the mistakes.
- Program is like the final letter, which is ready to be sent and read.
It means, we do programming, using a programming language, to produce a program.
There are hundreds of programming languages available like C, C++, Java, C#, Python, JavaScript, PHP and so on. Each one is designed for a specific purpose and has its own strengths, you must choose the right one depend on the problem you are solving. Most importantly, for beginners, the language is not the hard part, the problem solving thinking is. Once you learn it with one language, it is much easier to learn the second one.
Wrap up
In this article, we have looked at what is a program, what is programming, what is a programming language and how these three are connected. I appreciate your time and efforts to read this article. In the next article, I will walk you through the generations of programming languages, from the 0s and 1s of machine code to the languages which are very close to human language.
Related Posts
How programming languages work behind the scenes? - Part 5
This article explains how source code becomes a running program through compilers, interpreters, assemblers, linkers, loaders, bytecode and runtimes before machine instructions reach the CPU.
What are the generations of programming languages? - Part 3
This article follows five generations of programming languages, from binary machine instructions to high-level, very high-level and natural or logic languages, with examples and historical context.
How computers solve real-world problems? - Part 1
This beginner introduction shows how a real-world grocery problem becomes input, output, an algorithm and a program that a computer can execute step by step.