Hacker News new | past | comments | ask | show | jobs | submit login

”Within the first few paragraphs I've already heard how OOP is bad”

Whenever there is a discussion about ECS/DOD, “Object oriented” acquires a special meaning in that specific context. It is merely about a popular set of coding patterns used to structure games mostly based on heavy inheritance usage (and often also with lots of singletons).

ECS/DOD isn’t exactly a replacement for all OOP in a game code. It is mostly replacing what would be entities, managers, nodes, basically things that exist in multiples and have specific access patterns. Also: lots of DOD/ECS code and libraries are implemented using OOP + classes.

About performance: with the popularization of ECS the focus shifted away from performance alone. It is actually also a very rich paradigm/pattern that is heavily about dynamic composition and separation of concerns, and it achieves those things in a way that is IMO more elegant than the popular OOP approaches historically and currently used in games.

So I would argue that there isn’t really a tradeoff here when it comes to code quality and engineering.

But like I said above it can be implemented with OOP and classes: there is prior art for using this kind of dynamic composition in 90s software and books, for example.




DOD also has a non-architectural component (i.e. not just "use ECS" which is how it's often pitched), which can be summed up as: Represent your data in a way that's efficient to compute with, not a way that models "the real world" (increasingly irrelevant to most business processes anyway!) in your language du jour.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: