News for hackers. Stuff that matters.
Re:Functional programming is not popular because it is weird... by kaba0 on Wednesday September 15, 2021 @02:25AM (#28535877)
There are problems (or parts of problems) that are more about behavior and others that are more about data. The latter of course is benefited by a FP mindset/language, but I wager that OOP is a better fit for the previous.

What OOP gives is a way to encapsulate some given part of a program, and make it a working little building block you can later reuse. It can contain mutable state, but is promised to be correct as only that class can touch it, it can be used as a slightly different version of a common interface, etc.

The two are not mutually exclusive at all.

There are no comments on this comment yet.