Search This Blog

Monday, June 27, 2011

Introduction : Computer Programming - Ch:01 - Level 002

Programming Level 002


If you like this article, please click on +1 button and share with your friends.

Click here for the Video Tutorial of this article.
visit www.iGnani.com


Introduction

Before you jump in and start learning a programming language, it will be helpful to you if you understand what is programming and how it works, including some programming terminology.

A computer on its own is just a useless box. It’s nothing but a bunch of different hardware items assembled into a single unit. At this point, these hardware items either together or individually are of no use. This is as good as a Car that has been assembled. Is the car of any use without fuel? In the same way, we need to provide the computer with fuel, in this case its electricity (though there existed some types of mechanical computers, here we are referring to electrical machines). A computer at this point is essentially just a big bunch of tiny electronic switches that are either on or off. Now this is as good as a Car with enough fuel and can be driven, but no driver to drive.

We need a driver, who can operate the steering wheel, gears, breaks, etc., which will make the car move around. In the same way by setting different combinations of these switches, you can make the computer do something, for example, play a video on the screen or play a music video through the computer speakers or open a file, etc. Now telling a computer when to switch on these switches and when to switch off them is in other words nothing but instructing a computer what to do. This is what Programming is in very simple words.

Though it is not necessary, it is very important that before proceeding you know the basics of computers. We have covered computer basics in our tutorials “Computer Fundamentals”. Please feel to complete these tutorials before moving on in this topic.

Programming often refers to computer programming. So this now brings to our first and important question!

 

What is Programming?

Computer programming commonly known as programming or coding is the art of making a computer do what you want it to do. Programming in very simple terms is about writing programs. A sequence of instructions written to perform a specified task for a computer is known commonly as a Program, but is also referred to as a Software Program or even Computer Program. A computer being just hardware requires instructions to act upon. These instructions are executed in the computes CPU.

To know more about how CPU executes these instructions please check out our tutorial “Computer Fundamentals Part II”.

Programming is planning how to solve a problem. No matter what method is used -- pencil and paper, slide rule, adding machine, or computer -problem solving requires planning.

Based on the above definition, Programming is planning how to solve a problem. So here we are not actually solving the problem, but the computer will do it for us. If we solve the problem ourselves, then there is no necessity to write a program and hence, we don’t require a computer isn’t it.

Then why do we need a computer, simply because we know how to solve a problem and also know to instruct a computer to do it for us, but cannot do it at the speed & accuracy with which a computer can do it. Also we get tired & bored of doing the same job again and again, but the computer can do the same job a zillion times at the same speed & accuracy as the first one without getting bored or tired.

We can take a simple example of calculating the sum of all even numbers from 1 to 1,000,000. This is not something that we cannot do, but the time that is required to calculate, the possibility of making a mistake at some point of time, amount of resources required if we use a pen and a paper or a calculating machine, and other similar reasons make this an undesirable option. Over & above this, what if we need to calculate between different set of numbers again & again? It is difficult humanly. But by writing a program, we can achieve this in less than 5 min. At the same time we can keep running the same program again & again for doing any number of calculations and also we can get accurate results in seconds.

I can instruct the computer to take each number, add it with the next and from there on add every next number to the previous sum till we reach the upper limit specified. Don't look at these instructions for its accuracy, but what you need to understand here is that, I can instruct a computer to solve a problem only if I know how to do it. This means that unless I know the solution to the problem, it’s of no use even to try solving one.

You can take an example of a Cab driver on the street, but who is new to the city. With this cab driver, we cannot simple get into the car and ask him to drive to Point A. We will have to give him proper instructions on the route that he needs to take to reach the destination. I can give him the instructions on the route only if I know how. Otherwise, it will be a futile effort.

In the same way there is no point even trying to write a program until you have the knowledge of how you are going to set about solving the problem.

Put in simple words, Programming is telling a computer what to do. Though it seems to be pretty simple, it’s very complicated. You will have to keep in mind about two things here:

  • The very important point here is that Computers don’t speak English. Since a Computer being a machine only understands two basic concepts: on and off. The on and off concept is called binary system with on representing 1 and off representing 0. Hence Computer knows only one language that is of 0’s and 1’s commonly known as binary language.
  • The second important thing is that your instructions should be PRECISE. As I have mentioned previously, a computer on its own is just a useless box. It’s nothing but a bunch of different hardware items assembled into one unit.

So if you have to instruct a computer, then you have to tell them PRECISELY what to do.

Now I hope you have got to know the complexity in Programming.

In the previous video on Computer Programming! Level  2,  I spoke about what is programming and ended it by saying that computers do not understand English or for that matter any language we humans speak. I also said that computers only understands a language of 0's and 1's.


visit www.iGnani.com

MicroMind Information Systems
#4013, K.R. Road, Banashankari II Stage,
BANGALORE - 560070
KARNATAKA, INDIA
Phone: +91 80 26762747


Technorati Tags: , , , , , , , , , , , , , ,
Blogger Labels: Computer, Level, terminology, driver, combinations, tutorials, Fundamentals, sequence, instructions, Program, Software, tutorial, concepts, MicroMind Information Systems, hardware

No comments:

Post a Comment