Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A good heuristic: if you’re not dealing with “state” (i.e., Games, DB ORM, Reinforcement Learning), then don’t use OOP


I completely agree. Use it carefully if you need it but it shouldn't be the default.


Really? I’d say the accidental distribution of state across objects due to cross cutting concerns is exactly where OO breaks down for me.


If cross-cutting concerns are making your architecture unwieldy, you likely haven't used composition enough / are doing OOP the bad way (tm).


No, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: