Introduction to Programming

Programming Analogy

Lesson 1: Introduction

Getting Dressed

On days that you have to go to school, your mother and father are behind you in the morning, asking you to wake up, while you keep saying '5 more minutes!' until you realize it is late and you don't have time to take bath. So, you decide to just wash your face, brush your teeth, and get dressed.

To get dressed, you follow a particular sequence of steps, like the one given below:

  • Take off the pajamas
Cartoon boy wearing casual red shirt and brown pants before getting dressed for school
  • Take off the undergarments from the previous day
  • Wear a fresh pair of undergarments
Cartoon boy wearing a fresh pair of undergarments after removing previous day's clothes
  • Put on the school uniform
  • Wear accessories such as the belt, tie, and ID card
  • Wear socks
  • Wear shoes
Cartoon boy fully dressed in school uniform with white shirt and blue pants

Here, as you can see, you followed a set of instructions to complete a task, which is getting dressed (though hastily, and without taking a bath!).

Now, you know that you need to follow the order; you won't wear a fresh pair of undergarments before taking off the previous ones, nor would you put on the uniform first and then wear undergarments (unless you're Clark Kent!).

Similarly, you must write the program in a particular order so that the computer does the task given to it correctly, and we get the result that we expect.

Subscribe to our newsletter.

Get updates to news and events.