3 ms·
> same reason why it took some time for pure functional programming to take off too To be pedantic, almost nobody is using a pure functional language even mod
by Alupis 4y ago
> same reason why it took some time for pure functional programming to take off too
To be pedantic, almost nobody is using a pure functional language even modernly. Almost all languages that support functional programming are hybrid systems at this point in time, and still have anti-functional constructs such as classes and objects.
I dare say, it would be very difficult to maintain a large system that was purely functional. Some of the concepts revolving around OOP are indeed quite good and lead to better organized, more easily understood codebases.
The future is probably a hybrid approach, not a pure approach as some advocates would prefer.
- valenterry 4y agoClasses and objects don't contract PFP. Yeah every non academic language (that I know of) has escape hatches. Still, you can (and many do) write your code in a 99,99% pfp style in e.g. Scala.
- Alupis 4y agoThe idea of a class encapsulating functionality and traits is definitely at odds with PFP. PFP would prefer free functions, after all. However, a Data Class without mutability and without functionality (besides accessors) is in-line with PFP. Like I said, most modern systems are hybrids - taking the best of all paradigms instead of aligning with a singular paradigm as was done in the past.
- valenterry 4y agoNot really, at least not in my terminology. Classes (in the pfp world) are pretty much just a bundle of free functions with some predefined bindings that are available to all those free functions, and putting those functions into their own namespace. Those are valid things to do even in pfp. data classes are technically similar or even identical but conceptually a different thing (though of course also useful and needed).