Programming and it's Approaches

Programming is the backbone of present world full of technology and modern machines. Programming involves serious analysis of problem, developing required algorithm and flow-chart and coding followed by analysis and debugging. It is must for technology enthusiast. 

In this series we will deal with one of the fastest and portable high level programming language C++. But before that we have to understand the basic concepts of programming language and their approaches. 


There are basically two different approaches to program design. They are:

A. Top Down Approach

It is a traditional approach in which the design starts with the description of the overall system and usually consists of a hierarchical structure which contains more detailed description of the system at the lower level. The lower level design details continue until further subdivision is no longer possible. Procedure oriented programming language like C uses this approach in the program design.

B. Bottom Up Approach

It is a modern approach to program design in which the individual parts of a system are first specified in greater details and later these parts are linked together to form larger components which in turn is linked until a complete system is formed. Object oriented programming language like C++ uses this approach in the program designs.


Procedure Oriented Programming(POP)

→ Procedural programming is a conventional programming paradigm in which a complex task is broken down into a set of self contained and sufficiently small functions or modules.

→ This paradigm uses top down approach in the program design.

→ Programming languages like C, Pascal, FORTRAN, BASIC, etc are Procedure Oriented Programming languages.

→ They are also known as structured or modular programming languages.

→ As can be seen from the figure, in a procedure oriented program, a complex program is broken down in terms of self contained modules called function. These functions interact with each other through the function calls.

A. Characteristics of POP

i. Emphasis is given on the functions or algorithm.

ii. Large program is divided into functions.

iii. Most of the functions uses global variable/data.

iv. Data can flow freely among the functions.

v. Use top down approach in the program design.

B. Advantages of POP

i. It is very easy to write and follow.

ii. It is easy to debug. C. 

Disadvantages of POP

i. It is difficult to maintain the code for larger programs using POP paradigm. 

ii. Lack of code reusability.

iii. Lack of data hiding. 

iv. Lack of other modern object oriented programming features.


Object Oriented Programming(OOP)

→ Object oriented programming is a modern paradigm of programming in which a complex task is broken down in terms of classes and objects.

→Classes specify the data to be used and function that operate on them.

→ In fact, class gives the description of the objects to be created. Once the class has been created, one can create object of type class. i.e. an object that holds the characteristics or features specified in the class definition.

→ Object Oriented Programming follows the bottom up approach in the program design.

→ Examples of object oriented programming languages are: C++, Java, C#.net, VB.net, Smalltalk, PHP, Perl, Prolog++ and so on.

Features of OOP

  1. Class
  2. Objects
  3. Polymorphism
  4. Encapsulation
  5. Data Abstraction
  6. Message Passing

Advantages of OOP

  • provides a clear modular structure for programs.
  • good for defining abstract data types.
  • processing is separated from user display
  • easy to maintain and modify existing code
  • use of objects, classes support code reusability
  • Encapsulation, polymorphism, abstraction

Disadvantages of OOP

  • the relation among the classes become artificial sometimes.
  • Designing a program in OOP concept is a little bit tricky.
  • Adequate prior knowledge and concept is required before programming.
  • larger size of code compared to POP code

In this series of learning programming we will be dealing with C++ and learn all about it. 

Next Topic: Introduction of C++