Differences Between Object-oriented Programming & Functional Programming

By Hemanta Sundaray on 2022-02-12

Object-oriented Programming

In object-oriented programming (OOP), you structure your code based on the concept of objects.

In commonly used OOP languages (such as Java or C#), we create a template for an object using the keyword class and we instantiate an object using the keyword new. These objects contain fields that store data and methods that manipulate data. In this style, an object can be passed as an argument in the function of another object.

Functional Programming

In functional programming, you create a solution by structuring code mainly using functions. Functions are first-class citizens in this paradigm, meaning we can use them to store and manipulate data. Similar to objects in object-oriented programming, in functional programming, functions can be passed in as arguments to other functions and can be returned by other functions.

Join the Newsletter