Which paradigm(between OOP and Functional) should be chosen for a given task ? What are the tradeoffs between these two styles ? In which case using Functional makes sense and vice versa,in which case OOP should be used ?
we all know,
OOP: As the name suggests, when designing a system with object-oriented programming, you’re thinking about organizing your system as objects that have state and may change over time.
Functional: Functional programming, on the other hand, is all about inputs and outputs; that is, viewing your system as functional “black boxes” that are given inputs and return outputs that can then be given as inputs to other black boxes, and so on and so forth. For that reason, if your system has lots of streams of data that you want to transform, functional programming might be the way to go.
I want to know the tradeoffs between these two styles,In which case using Functional makes sense and vice versa,in which case OOP should be used ?