4 ms·
Classes 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
by valenterry 4y ago
Classes 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).