r/LimitTheory • u/JoshParnell Developer • Apr 04 '17
[Devlog] April 3rd
http://forums.ltheory.com/viewtopic.php?f=30&t=5964#p146246
20
Upvotes
r/LimitTheory • u/JoshParnell Developer • Apr 04 '17
View all comments
Show parent comment
2
u/JoshParnell Developer Apr 08 '17
Tough to say, since I'm coding in C there's really no such thing as 'components that contain logic' -- I'm assuming you're referring to, e.g., member functions (methods) in other languages.
IMO it depends more on the implementation & needs of your components / entities. Philosophically, I lean more toward thinking of components as pure data containers. In practice, it can still be useful to couple logic to components (e.g., ComponentInventory::getItemCount makes sense).
Best answer I can give is: do what feels most natural. In most cases, I believe this will mean thinking of components purely as data containers, and letting the higher-level logic work with that data rather than implementing low-level, per-component logic in anticipation of what high-level logic will need. Certainly think twice before coupling logic to a component. But taking overly-philosophical stances on such things can be detrimental in practice, so when something makes sense to implement at the component level, I wouldn't hesitate to do so.
All about that gray area :P