3 ms·
A good heuristic: if you’re not dealing with “state” (i.e., Games, DB ORM, Reinforcement Learning), then don’t use OOP
by zdmc 8y ago
A good heuristic: if you’re not dealing with “state” (i.e., Games, DB ORM, Reinforcement Learning), then don’t use OOP
- lerno 8y agoReally? I’d say the accidental distribution of state across objects due to cross cutting concerns is exactly where OO breaks down for me.
- Hodgman 8y agoIf cross-cutting concerns are making your architecture unwieldy, you likely haven't used composition enough / are doing OOP the bad way (tm).
- lerno 8y agoNo, some logic simply isn’t cleanly decomposable, plus the main problem here is that objects lets you get away with implicit state (e.g. if (this.x == 0) doA() else doB(); ) for long enough that when you start realizing you need explicit state, it’s usually distributed quite a bit.
- bribri 8y agoI completely agree. Use it carefully if you need it but it shouldn't be the default.