Some of the programming techniques followed since the evolution of computer
programming is as follows:
1. UNSTRUCTURED PROGRAMMING:
Here “main program” stands for a sequence of commands or statements
which modify data which is global throughout the whole program.
This programming technique provides
tremendous disadvantages once the
program gets large due to repeated
statement.
2. PROCEDURAL PROGRAMMING:
The main program is divided into small sub
programs called procedures.
The main program is responsible to pass data to the procedure and the data is
processed by the procedure.
Once the program execution is
finished the resulting data is
presented.
Programs can be more structured
and error free.
3. MODULAR PROGRAMMING:
The process of splitting the
lengthier and complex programs into number of smaller units (modules) is called
modularization. And programming with such an approach is called modular
programming.
This technique provides grouping of procedures which are of common
functionality into separate modules. A program therefore no longer consists of
only one single part.
It is now divided into several small parts which interact through procedure calls and
which form the whole program
Some of the advantages of modularity in programming are as follows
Reusability: If a particular set of instructions is to be executed repeatedly from
several different places within the program, then we can make this group of
instructions as one module and call it whenever necessary. This avoids rewriting the
same function every time we need it.
Inter
nal
Use -
Confi
denti
al
Debugging is easier: Since each module is smaller and clearer,
the user can easily locate the errors and correct them.
Building Library: It is possible for the programmer to build his/her
own library of the most commonly used functions. This reduces the
time and space requirements of the programs.
Portability: Since the functions and library are common across
different Operating Systems, it is easier for us to port and execute
them without much or no modifications.
4. STRUCTURED PROGRAMMING: Structured
programming is a method of programming by using the following
types of code structures to write program:
Sequence of sequentially executed statements.
Conditional execution of statements (i.e., if, if-else statements)
Looping or iteration (i.e., for, do-while and while statements)
Structured subroutines calls (i.e., functions)
NOTE:
“Please refer class notes for more examples on
algorithms and flowchart.”
Inter
nal
Use -
Confi
denti
al