Procedure versus Object-Oriented Programming

Program and data are the two basic elements of any programming language.  Data plays an important role and it can exist without a program, but a program has no relevance without data.  The conventional high-level languages stress on the algorithms used to solve a problem.  Complex procedures have been simplified by structured programming. 

There are two paradigms that given how a program is constructed. The first way is called the process-oriented model.  This approach characterizes a program as a series of linear steps.  The process-oriented model can be taught of as code acting on data. Procedural languages are also called as Function oriented programming.  (C language).  

The second approach is called object-oriented programming.  It organizes a program around its data and a set of well-defined interfaces to that data.  An object-oriented program can be characterized data controlling access to code. 


Procedural Programming

Unlike Function oriented programming, Object oriented programming emphasizes on data rather than the algorithm.  In OOP, data is compartmentalized or encapsulated with the associated functions and this compartment is called an object. In OO approach the problem is divide into objects, whereas in FOP the problem is divided into functions.  OOP contains FOP and so OOP can be referred to as the
super set of FOP. 

OOP uses objects and not algorithms as its fundamental building blocks.  Each object is an instance of some class. Classes allow the mechanism of data abstraction for creating new data types.  Inheritance allows building of new classes from the existing class. 

Unlike traditional languages OO languages allow localization of data and code and restrict other objects from referring to its local region.  OOP is centered on the concepts of objects, encapsulation, abstract data types, inheritance, polymorphism, and message-based communication. An OO language views the data and its associated set of functions as an object and treats this combination as a single entity.
Thus, an object is visualized as a combination of data and functions, which manipulate them. During the execution of a program, the objects interact with each other by sending messages and receiving responses.