3 ms·
ECS makes sense in games because OOP enforces lots of rules downstream in your inheritors, which is good for GUIs, but bad for games when producers keep asking
by seanalltogether 3y ago
ECS makes sense in games because OOP enforces lots of rules downstream in your inheritors, which is good for GUIs, but bad for games when producers keep asking for that one npc or boss to do something special that breaks the rules. ECS is just so much more flexible which is good for some design systems and bad for others.
- baq 3y agoE.g. react does just fine with functional components; I'd say it does much better than with the old class-based ones. Inheritance works well enough in exception classes, e.g. I can catch OSError and specifically handle FileNotFoundError differently on a language level, but it's nothing composition couldn't handle, either.
- Coder1996 3y agoI disagree re: React. To me, class-based has one advantage over functional. A component is an object and therefore perhaps ought to be represented by a class. That being said, functional maybe is a bit simpler.
- baq 3y ago> A component is an object and therefore perhaps ought to be represented by a class. That's what those who ditch inheritance altogether when designing languages challenge and it turns out not much of value is lost :) 'Component is an object' is something you'd hear from an OOP practitioner which isn't exactly convincing to people thinking functionally.
- Coder1996 3y agoI actually use a little bit of both OOP and functions. What I don't understand, I suppose, is if a Component isn't an object that acts, then what is it?