Difference Between Functional And OOP approach

Difference Between Functional & OOP approach

       Conventional Programming, Using high Level Languages such as COBOL, FORTRAN and C, is commonly Known as procedure-oriented programming(POP) , In the procedure-oriented approach, the problem is viewed as  a sequence of things to be done such as reading calculating and printing. A number of functions are written to accomplish these tasks. The primary focus is on functions. A typical Program structure for procedural programming is shown in Fig, 1, The technique of hierarchical decomposition has been used to specify the tasks to be completed for solving a problem. 


Fig. : Typical structure of procedure-oriented programs


Procedure-Oriented programming basically consists of writing a list of instruction for the computer to follow, and organizing these instructions into groups known as functions. We normally use of flowchart to organize these actions and represent the flow of control from one action to another. While we concentrate on the development of functions, very little attention is given to the data that are being used by various functions. What happens to the data? how are they affected By the functions that work on them?

In a multi-function program. many important data items are placed as gloal so that they may be accessed by all the functions. Each function may have its own local data. Figure 2 shows the relationship of data and function in a procedure- oriented program.

Fig.2: Relationship Of data and function in procedural programming

  • Emphasis is on doing things.
  • large programs are divided into smaller programs known as functions.
  • Most of the functions share global data.
  • Data move openly around the system from function to function.
  • Functions transform data form one form to another.
  • Employs Top-down approach in program design.

Comments

Post a Comment

Popular posts from this blog

Reusability In OOP

Encapsulation and Data Abstraction In OOP

Polymorphism ,operator overloading,function overloading,dynamic binding