Sunday, July 22, 2012

What is a program?

This post will explain the basic terminologies used in the software world. Let’s start with a 'Program'. My mother always asks me, what do you in the office all day with the computer. I am sure with this she is going to will understand that I am doing useful stuff. Ok, now, what is a program? Something similar to the steps involved in solving a mathematical problem!! Let’s start with an example, if you were to find out, say the perimeter of a square given its area, then you would plan to write something like this

Let 'a' be the side of the square
Let 'p' be the perimeter
Given 'area' is 25
Calculate the side 'a' as square root of 'area'
So p = 4 * a

The same happens in a programming language too. You know the logic but instead of writing in English you are going to be writing in a different way. This way or the rules/method is called the syntax of a language. Each language has its own syntax/way of writing the code. Why a different syntax for each language? I will get into this in the next topic - Compilers/Interpreters. I tell all the beginners, first write your logic in English called the Pseudo code. Once you know how to solve the problem, and then start with your program. Additionally each language offers its own features, functionality and they have their own purpose for existence. A programming language is not only to solve a mathematical problem though it first originated for calculations and automation. [I will get into what automation is in my future posts]. I will conclude saying a program is a sequence of steps to solve a problem.

No comments:

Post a Comment