Friday, 3 April 2009

Baby Steps 1

Okay guys here goes step one.
Lets first understand what is a software or a programme I don't know what books say or the proper definition but I shall give you my understanding of this art.
A program is a set of logical instructions written to perform a specific task or tasks
Lets break it up in different part.
To begin with what do I mean by tasks ?.............Does it mean buying groceries or taking the rubbish out or cleaning your room ? Yes and No. Yes because they are example of tasks which you may perform in your daily life but these are not the tasks I am aiming for in the above mentioned definition. These tasks one day may be done by by robots or computers but for now lets keep it simple shall we. A task for your program may be adding two numbers and printing the answer on the screen. Or it may be adding all the marks obtained by every student in your class and find the average marks. Or it may be finding the shortest route between to cities. the list is endless and it becomes more and more complicated as we go on.
The first part of definition was set of instructions. This we all are familiar with. Do you remember when your mother gives you a list of do's and dont's when you leave for school or when she instructs you to perform your daily chores around the house. Lets us see a simple instruction dealing with garbage.

Step 1 Empty The Bins Inside the House
Step 2 Put New Bin Bags Inside The House
Step 3 Carry The Old Used Rubbish Bags Outside
Step 4 Bin The Bags In The Rubbish Bin

So we see a simple chore is actually a set of instructions.
I shall rewrite these steps in a different order.

Step 1 Bin The Bags In The Rubbish Bin
Step 2 Put New Bin Bags Inside The House
Step 3 Carry The Old Used Rubbish Bags Outside
Step 4 Empty The Bins Inside The House

Do you see the difference? Lets imagine you are a robot who has no brains but understands english. Please switch off your brain for a instance and read the first step. 'BIN THE BAGS IN THE RUBBISH BIN' ..what bin bags......where do i get them....?????
'PUT NEW BIN BAGS INSIDE THE HOUSE' .....Where do I put them no space on the already full bins.....?????
'CARRY THE OLD USED RUBBISH BAGS OUTSIDE'....what old bags there are none......????
If you were a computer who only understands the instruction without any power of thinking the above mentioned steps would be impossible. What is the difference between the two sets. As you can clearly see the instructions are the same then why...because we have changed the order and the order has no meaning or logic behind it for the computer to understand.
If you are confused I shall advise you to read the text again and wait till you understand to go any further because I am going to develop the idea further in my next post.

No comments:

Post a Comment