Large speeds of executing operations and large capacity of storage are some of the most important characteristics of computers. However in order to be useful in everyday life, computers need to be instructed on what to do and how to do it.
Programming is about instructing computers to do things the way you want them to do it. A computer program is a set of basic instructions that the computer follows in order to achieve a well defined task. A programmer is a professional person who writes, tests and debugs sets of computer instructions, called computer programs.
A computer is a set of electronic circuits that use two electric levels: 1 and 0. Of course the instructions given to the computer, in order to execute certain tasks, need to follows certain rules just like the languages human use. The languages used to write computer programs are called programming languages which are then translated into a machine language using the two levels 1 and 0 that the computer understands.
Examples of computer languages are: Java, C, C ++, Lisp, Cobol, Pascal and Fortran.
When using Java language for example, a simple text editor may be used to write a computer program. The following is a Java computer program saved in a text file called FirstExample.java.
class FirstExample {public static void main(String[ ] args){
System.out.println("This is my first program !");
}
}
The above program needs to be translated into a language the computer understands and is therefore translated using a compiler using the commands javac as follows.
javac FirstExample.java
which produces a file of the form FirstExample.class. When FirstExample.class is run using the command java as follows
java FirstExample.class
it produces the output
This is my first program !