You Already Know How to Program — You Just Don't Know It Yet

Your motorcycle dies in the middle of nowhere. What do you do?

First, you check the fuel. 
If not the fuel, you try to kick-start it. 
If that fails, you check the spark plug.
If the spark plug is fine, you check the engine wiring. 
Else, if nothing works, you call a mechanic.

The problem was simple: your bike broke down.
To solve that problem, you came up with a step-by-step solution. If the problem is solved in the first step, there’s no need to continue with the remaining steps. But as the cause is unknown- listing all possible solutions you knew, in order, to fix the problem was necessary.

An Algorithm is a step-by-step approach to solve a problem; it is the blueprint of execution.

The broader your view on the problem- the better will be the algorithm.

Haven’t you been using algorithms your whole life? Think of situations where you unconsciously executed them.

Every problem needs an algorithm. Some are simple, some are very complex; depending on the solution. But the fundamental idea is: break the problem into smaller steps until a solution is reached.

Humans have been using algorithms for thousands of years to solve problems.

If humans were solving problems, why were computers invented?

We evolve. Every time something felt tedious, we made tools to simplify the process.

Imagine solving 982,731 × 638,249:
You can do it, it’ll just take time. But for a modern computer it’s a matter of milliseconds.

Computers were invented to execute instructions faster, more accurately, and without getting tired.

But how can we instruct a computer to perform a certain task?

Whenever a problem is encountered, we make algorithms. These algorithms, when given to a computer, give you the solution. The process of telling a computer, in a way it understands is programming.

Why do different programming languages exist and how can we write a program? Find out in the next article.