
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
Python Object-oriented and Functional Programming
The object-oriented and Functional Programming are both Programming Paradigms. Paradigms classify programming languages based on their features. Programming Languages can be classified into multiple paradigms. For example, Python is a structured, object-oriented and functional programming language.
Before moving to the difference, let us understand Object-Oriented and Function Programming paradigms:
Object Oriented Programming Paradigm (OOPP)
The Object-Oriented programming paradigm plays a key role in human computer interface. It has different components that takes real world objects and performs actions on them, making live interactions between man and the machine.
Following are the components of OOPP −
- This paradigm describes a real-life system where interactions are among real objects.
- It models applications as a group of related objects that interact with each other.
- Programming starts with the concept of real-world objects and classes.
- Application is divided into numerous packages.
Functional Programming
Functional programming languages are specially designed to handle symbolic computation and list processing applications. Functional programming is based on mathematical functions. Some of the popular functional programming languages include: Lisp, Python, Erlang, Haskell, Clojure, etc.
The most prominent characteristics of functional programming are as follows −
Functional programming languages are designed on the concept of mathematical functions that use conditional expressions and recursion to perform computation.
Functional programming supports higher-order functions and lazy evaluation features.
Like OOP, functional programming languages support popular concepts such as Abstraction, Encapsulation, Inheritance, and Polymorphism.
Object-Oriented vs Functional Programming
Following is the difference −
Basis | Object-Oriented Programming | Functional Programming |
---|---|---|
Paradigm | This Object-Oriented paradigm describes a real-life system where interactions are among real objects. | Functional programming paradigm is designed to handle symbolic computation and list processing application |
Data and Functions/ Procedures | The data is more important than procedures. | The functions are more important than data |
Data Hiding | In object-oriented programming, it binds the code and the data together and keeps them safe from outside interference | Functional Programming doesn’t support Data Hiding. |
Parallel Programming | Does not support Parallel Programming | Supports parallel programming |
Programming Model | Imperative programming model is followed. | Declarative programming model is followed |
Access Specifiers | Object-Oriented Programming has access specifiers to set the accessibility of classes, methods, and other members. | Functional Programming doesn’t have access specifiers. |
- Related Articles
- Object Oriented Programming in Python?
- 8 Tips For Object-Oriented Programming in Python
- Object-oriented programming in Swift
- Object-Oriented Programming in R
- Differences between Procedural and Object Oriented Programming
- What is the difference between Object oriented programming and Object based programming?
- What is Data Hiding in Python Object Oriented Programming?
- Object Oriented language v/s Procedure oriented programming language.
- What is object-oriented programming (OOP)?
- What are basic Object oriented programming concepts?
- What does the repr() function do in Python Object Oriented Programming?
- What does the str() function do in Python Object Oriented Programming?
- What does the cmp() function do in Python Object Oriented Programming?
- Object Oriented language v/s Object based programming language.
- Functional Programming in Python
