Difference between Functional Programming and Object Oriented Programming

Object-oriented languages are good when you have a fixed set of operations on things, and as your code evolves, you primarily add new things. This can be accomplished by adding new classes which implement existing methods, and the existing classes are left alone.

Functional languages are good when you have a fixed set of things, and as your code evolves, you primarily add new operations on existing things. This can be accomplished by adding new functions which compute with existing data types, and the existing functions are left alone.

FUNCTIONAL PROGRAMMING OBJECT ORIENTED PROGRAMMING
This programming paradigm emphasizes on the use of functions where each function performs a specific task. This programming paradigm is based on object oriented concept.Classes are used where instance of objects are created
Fundamental elements used are variables and functions.The data in the functions are immutable(cannot be changed after creation). Fundamental elements used are objects and methods and the data used here are mutable data.
It follows declarative programming model. It follows imperative programming model.
It uses recursion for iteration. It uses loops for iteration.
It is parallel programming supported. It does not support parallel programming.
The statements in this programming paradigm does not need to follow a particular order while execution. The statements in this programming paradigm need to follow a order i.e., bottom up approach while execution.


Functional Programming in Python

Functional programming is a programming paradigm in which we try to bind everything in pure mathematical functions style. It is a declarative type of programming style. Its main focus is on “what to solve” in contrast to an imperative style where the main focus is “how to solve“. It uses expressions instead of statements. An expression is evaluated to produce a value whereas a statement is executed to assign variables.

Similar Reads

Concepts of Functional Programming

Any Functional programming language is expected to follow these concepts....

Functional Programming in Python

Python too supports Functional Programming paradigms without the support of any special features or libraries....

Difference between Functional Programming and Object Oriented Programming

Object-oriented languages are good when you have a fixed set of operations on things, and as your code evolves, you primarily add new things. This can be accomplished by adding new classes which implement existing methods, and the existing classes are left alone....