Friday 11 April 2014

Programming - Environment

Though Environment Setup is not an element of any Programming Language, it is the first thing we need to start programming with any Programming Language.
When we are saying Environment Setup, it simply means we need to have a base on top of which we can do our programming. Thus, we need to have required software setup, i.e., installation on our PC which will be used to write our Computer Program, Compile and Execute it. For example, if you need to browse Internet, then you need the following setup on your machine:
  • A working Internet Connection to connect to the Internet.
  • Web Browser like Internet Explorer, Chrome, or Safari, etc.
Similar way, you will need following setup to start with programming using any programming language.
  • A text editor to create computer program.
  • A compiler to compile program into binary format.
  • An interpreter to execute program directly.
If you are new to the computer, you yourself will not be able to set up either of these Softwares. So, I suggest you take help from any technical person around you to set up programming environment on your machine from where you can start. But for you, this is important to understand what are these items.

What is Text Editor?

This is a Software, which will be used to write your computer program. Your Windows machine must have a Notepad, which can be used to type your program. You can launch it by following these steps:
Start Icon → All Programs → Accessories → Notepad → Mouse Click on Notepad
This will launch Notepad with the following window:
Notepad You can use this software to type your computer program and save it in a file at any location. You can download and install other good editors like Notepad++, which is freely available.
If you are Mac user, then you will have TextEdit or you can install some other commercial editor like BBEdit, etc., to start with.

What is Compiler?

You write your computer program using your favorite programming language and save it in a text file called program file. What is next?
Let's try to get a little more detail on how computer understands a program written by you using a programming language. Actually, computer cannot understand your program directly given in the text format, so we need to convert this program in a binary format, which can be understood by the computer.
The conversion from text program to binary file is done by another software called Compiler and this process of conversion from text formatted program to binary format file is called program compilation. Finally, you can execute binary file to perform the programmed task.
We are not going into detail of different constituents of a compiler and different phases of compilation.
Following flow diagram gives an illustration of the process:
Compiler So, if you are going to write your program in any such language, which needs compilation like C, C++, Java and Pascal, etc., then you will need to install their compilers before you start programming in such languages.

What is Interpreter?

We just discussed about Compiler and Compilation Process. This is required in case you are going to write your program in a programming language, which needs compilation into binary format before its execution. Few examples of such programming languages are C, C++, Java.
There are programming languages like Python, PHP and Perl, which do not need any compilation into binary format, rather an interpreter can be used to read such program line by line and execute it directly without any further conversion.
Interpreter So, if you are going to write your program in any such language, which does not need compilation like PHP, Python, Perl, and Ruby, etc., then you will need to install their interpreters before you start programming in such languages.

No comments:

Post a Comment