Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Object-Oriented Programming (OOP) is about using objects that hold information and actions together. It helps make code organized and reusable by letting objects share traits and behaviors.
Functional Programming (FP) focuses on using functions as the main building blocks. It likes to keep data unchanged once it’s set and prefers functions that always give the same result for the same input.
Impact on Software Development:
Functional Programming:-
In essence, functional programs behave like common math functions, such as the calculations behind a conversion from Celsius to Fahrenheit. With functions, the same inputs consistently lead to the same result.
One example of the functional method is Google’s implementation of MapReduce and its approach to returning results to certain search terms. MapReduce connects search terms in the form of key-value pairs using a function called reduce. This process aggregates the search terms and assigns each one a value that will indicate what type of result it should return. Given the same data set, Google will spit out the same answer every time without side effects.
Object-Oriented Programming:-
On the other hand, object-oriented programming can contain state-dependent variables, which means objects don’t necessarily retain consistent values. For example, imagine a method designed to return an average salary rate, which is $50,000. If a developer runs a method that adds 10% to that total, then asks for the salary again, the returned value is $55,000. Object-oriented programs can also contain global and static variables that will make responses different every time.
Object-oriented programming is a well-known development approach, and often underlies the structured programs most developers learn to write in the early stages of their career.