3 ms·
The problem is that it is a giant internal state. And your class can be thousands of lines long. Of which you have to keep open, as you develop it. Which for
by blackrock 6y ago
The problem is that it is a giant internal state.
And your class can be thousands of lines long. Of which you have to keep open, as you develop it. Which forces you to keep the entire code base in your head, thus increasing the cognitive load on developing the classes.
Of course, there may be ways to refactor it, but the tools given in most OOP languages, tends to be insufficient.
- kaba0 6y agoIt’s as big of an internal state as you make it/minimum as large as the problem domain requires. Functional programming doesn’t solve any of these problems by itself. There are cases where mutating state is better, and there are others, where it is worse fit. And the latter can just as well be expressed inside a class, like there is no requirement for mutation. I think the two should go hand-in-hand, and for different parts of a program different paradigms can be used? Maybe even add actos-based programming as a possibility, but there is nothing inherently bad with OOP imo, and it is the best way to encapsulate some logic.