Procedural programming languages:

  1. Procedural programming languages focuses more on the logic, and the functionality.
  2. Less priority will be given for data security, in procedural programming languages.
  3. Top-Down design approach is followed in procedural programming languages.
  4. eg: C, Pascal are examples for procedural languages.

Object Oriented programming languages:

  1. Object Oriented programming languages focuses more on data and data security.
  2. Less priority will be given for logic and functionality.
  3. Bottom-Up design approach is followed in Object Oriented programming languages.
  4. eg: Java, .NET, C++, Ruby On Rails are examples for Object oriented programming languages.

what is procedural programming?

For a given problem, in finding out the solutions for that problem generally we will start thinking what the procedure to solve that problem is. Meaning emphasis will be given more to the sequence of steps to be followed to address that problem. In doing so we will give less weighteage to data on which we are performing the operations
Example: take a simple scenario where you have a stack and you need to perform push & pop operations on that stack. Immediately what comes to our mind is that what are the steps that I am going to follow to push some data into that stack & what is the conditions I need to check to pop some data out of that stack. Here we will ignore so many simple things like: a. Who will maintain that stack? (data) b. Is it secured or anyone can access that stack? Rather than focusing on where data [or] stack lies, programmer will start thinking about how to push and pop. His major focus will be on what is the condition checks I need to do before pushing and popping, what if I the stack is full or what if the stack is empty? These kind of questions will comes to programmer mind. And on his way he completely ignores where to hold that data and whether it needs to be secured or not.

Procedural programming design:

This design talks about how a programmer is going to design the solution for a given problem in procedural programming.
Let's take the same above example of pushing and popping elements on stack. Now when this problem is given, then below is the sequence of steps followed or thought by a programmer. Step1: Starting a program with a main function from where my execution starts. Step2: Initialize data what is required for doing pushing & popping operations. Step3: Call push functionality & pop functionality from main() Step4: Write push functionality. a.Check if stack is not full b.If stack is not full push the data given and increment the count. c.Else throw error saying stack is full Step5: write pop functionality a.Check if stack is empty b.If not then pop out the top element and reduce the count c.Else throw error saying stack is empty. This is how a procedural programming design happens. It is also known as top-down design pattern. Global Array[] of sack

Object oriented programming languages:

What is an object oriented programming?

For a given problem, in object oriented programming the programmer will start thinking about what are all the objects/data involved in finding the solutions for that problem. They will also think how objects will communicate among themselves. In an object oriented programming everything that we will do will lie within the boundaries of an object."data" of a given object will be given highest importance. Once we build objects with data, then we will think of how to communicate between objects and find the solutions for that given problem. Suppose take a classical example where a person "Raj" wants to ask money from other person "Jaz". In that scenario it would be strange if "Raj" tries to go and take purse of "Jaz" without permission. Here 'purse' is holding some secured data which belongs to "Jaz". In real time scenarios we do follow some rules and regulations if we want to take some "data" from others, in above case 'money' is the critical data of another object "Jaz". Instead of directly going and taking others purse, we generally prefer to ask"Jaz please give money". Same thing can be represented in OOPs as "Jaz.giveMoney()". This examples tells how critical the data of an object has to be. Same is observed in OOPs languages where data will be fully secured and exposed to outside world through the functions. Take the same"implementing stack" example in OOPs. You have a stack and you need to perform push & pop operations on that stack. As per the object oriented concept immediately that comes to our mind is what are the objects that are involved in implementing solutions for this problem. Here in our case the main thing that should be kept secured is the array data structure on which we perform "push & pop" operations. So we define a class"Stack" with data called as"array" in that. Once we define this class/ object with the data part, then we will start thinking about the methods to operate on that data. The methods that comes to our mind will be"push(int) & pop()". Inside those methods we will start implementing the logic to push and pop the data. Same methods will be given acting as an interface/ gateway to outside world if somebody wants to push/pop data on that array. Here the main that we are taking care is: a. We are giving the data - highest priority. b. Then we will expose some functions to outside world to access our private information. c. Nobody can access our privately secured data without our knowledge.

Object oriented programming design:

This design talks about how a programmer is going to design the solution for a given problem in object oriented programming. Let's take the same above example of pushing and popping elements on stack. Now when this problem is given, then below is the sequence of steps followed or thought by an object oriented programmer. Step1: Find out how many objects/ classes involved in framing solutions for the above problem. Step2: Identify the secured data that has to sit with in that class & declare that data as private in that class. This data cannot be accessed outside of your class; it can be only accessed by your class functions. Step3: figure out the methods to operate on the data of that class. And implement those functionalities to perform"pushing & popping" operations on the data. Step4: Make those functions as public if you wish to expose those functions to outside world as interfaces to access your class's private data. Note: Here if you see the approach of an oops-programmer in developing solutions for a given problem, he is more concentrating on a. Identifying objects b. Identifying its secured data c. And identifying communication mechanism between the objects.

Below picture depicts the design approach in OOPs:

apporchOOPs