FUNCTIONAL PROGRAMMING | OOP |
Does not exist State | Exists State |
Uses Immutable data | Uses Mutable data |
It follows Declarative Programming Model | It follows Imperative Programming Model |
Stateless Programming Model | Stateful Programming Model |
Main Fcous on: “What you are doing” | Main focus on “How you are doing” |
Good for Parallel (Concurrency) Programming | Poor for Parallel (Concurrency) Programming |
Good for BigData processing and analysis | NOT Good for BigData processing and analysis |
Supports pure Encaspulation | It breaks Encaspulation concept |
Functions with No-Side Effects | Methods with Side Effects |
Functions are first-class citizens | Objects are first-class citizens |
Primary Manipulation Unit is “Function” | Primary Manipulation Unit is Objects(Instances of Classes) |
Flow Controls: Function calls, Function Calls with Recursion | Flow Controls: Loops, Conditional Statements |
It uses “Recursion” concept to iterate Collection Data. | It uses “Loop” concept to iterate Collection Data. For example:-For-each loop in Java |
Order of execution is less importance. | Order of execution is must and very important. |
Supports both “Abstraction over Data” and “Abstraction over Behavior”. | Supports only “Abstraction over Data”. |
We use FP when we have few Things with more operations. | We use OOP when we have few Operations with more Things. For example: Things are classes and Operations are Methods in Java. |
No comments:
Post a Comment