+ 3
Functional and oop programing difference
I always confuse with these words. Could you explain them with examples
2 Answers
+ 11
⧠Object Oriented Programming (oop) â§
â This programming paradigm is based on object oriented concept. Classes are used where instance of objects are created
â Fundamental elements used are objects and methods and the data used here are mutable data.
â Importance is given to data rather than procedures.
â It follows imperative programming model.
â It uses loops for iteration.
â It does not support parallel programming.
â in this programming paradigm need to follow a order i.e., bottom up approach while execution.
â Has three access specifiers namely, Public, Private and Protected.
â Provides and easy way to add new data and functions.
â Provides data hiding. Hense, secured programs are possible.
+ 8
⧠Functional Programming â§
â This programming paradigm emphasizes on the use of functions where each function performs a specific task.
â Fundamental elements used are variables and functions.The data in the functions are immutable(cannot be changed after creation).
â Importance is not given to data but to functions.
â It follows declarative programming model.
â It uses recursion for iteration.
â It is parallel programming supported.
â The statements in this programming paradigm does not need to follow a particular order while execution.
â Does not have any access specifier.
â To add new data and functions is not so easy.
â No data hiding is possible. Hence, Security is not possible.