4 ms·
> I once heard someone tell me that good OOP ends up looking very functional. Immutability and thinking about if a class should really be stateful are the majo
by dehrmann 6y ago
> I once heard someone tell me that good OOP ends up looking very functional.
Immutability and thinking about if a class should really be stateful are the major wins.
I was recently looking over some code that essentially just did transformations, but all the inputs and outputs were member variables, so it took some effort to track what creates what and what depends on what. The members also had empty defaults, so if you mix up the order you call the functions in, the code still appears to work. It wasn't "wrong;" it was hard to follow and error-prone.