4 ms·
> When you maximize the number of pure methods, minimize mutable state, minimize inheritance and so on, you are doing OOP well. Odd, that's also how you do fun
by cbd1984 11y ago
> When you maximize the number of pure methods, minimize mutable state, minimize inheritance and so on, you are doing OOP well.
Odd, that's also how you do functional programming well.
(As regards functional programming languages not having inheritance as such, well, if you don't do any inheritance you're certainly minimizing it.)
More and more, I feel that mutable state is really an advanced topic and should be treated with the kind of suspicion we usually reserve for multiple indirection and undisciplined use of the goto statement.
- alkonaut 11y ago> I feel that mutable state is really an advanced topic and should be treated with the kind of suspicion we usually reserve for multiple indirection and undisciplined use of the goto statement. This. Mutable state is the goto of the 90's. Something that linters and compilers of the future will warn us about, just like we today might have to put pure pointer arithmetic in C# inside some unsafe block because we need to express that "trust me I know what I'm doing".