Re:Eloquent JavaScript 3rd Edition (2018)
by colordrops on Monday April 27, 2020 @12:34AM
(#22992910)
OOP and functional programming aren't mutually exclusive.
[ Parent
| on HN ]
Re:Eloquent JavaScript 3rd Edition (2018)
by archarios on Monday April 27, 2020 @12:09PM
(#22997151)
How do you define object-oriented programming? From my perspective the very core of it is stateful objects with encapsulation and methods on those objects that pretty much always are not pure. If you just start treating objects like collections of functions, I don't really see how that's OOP. As far as I remember, it has been a little bit since I've used OOP everyday, pretty much every facet of the paradigm is centered around mutating state. You can certainly commingle OOP and functional code, but they simply aren't compatible paradigms.