3 ms·
For the sake of loose coupling, which allows modules to be improved in large systems without having to keep the entire large system in your head, data hiding is
by rectang 6y ago
For the sake of loose coupling, which allows modules to be improved in large systems without having to keep the entire large system in your head, data hiding is necessary as a general engineering principle.
From my perspective, ECS looks like an optimization where you make the engineering tradeoff to sacrifice data hiding. For very good reasons! Memory locality is super important when iterating over elements the way it is typically done in ECS, such as when rendering objects in a game.
- adamnemecek 6y agoThe way you do things in ECS is that you query all things that have particular field. As a result, you don't really need to remember what type do the field you are operating on really have, you are operating on the columns of a db, not the row of a db.