Re:OOP Is Dead, Long Live OOP
by LiterallyDoge on Thursday October 18, 2018 @02:09PM
(#18250642)
I don't understand why this article is so angry? ECS is a great subset of OOP. Both are helpful tools where they make sense.
[ Parent
| on HN ]
Re:OOP Is Dead, Long Live OOP
by thrower123 on Thursday October 18, 2018 @03:28PM
(#18251369)
For at least the last ten years, maybe fifteen, on the GameDev.net forums you haven't been able to swing a dead cat without hitting somebody going on and on about entity/component systems or pushing them as the One True Path, or trying to create their own implementation. It's probably worse now that Unity is so big. I'm not sure it is something I would pitch at beginning programmers, and there are a lot of them that wander into that, decide they are going to follow that advice, make a big mess, then wind up asking Hodgman and the handful other saintly regulars that keep that place going, to help them out.
It's because every single article that's promoting ECS does so by comparing it against incorrect inheritance-based code.
The amount of time you see newbies jumping on the ECS bandwagon because inheritance is bad, while they don't yet understand OOP, ECS, procedural, relational, or functional... is infuriating.
Do both. Teach how to use composition. Teach how to use the relational model. Don't avoid teaching either by using misleading sales tactics.
ECS as they are using it in this blog is about Data Oriented Design. It's not just OOP plus favoring composition over inheritance.
DOD explicitly advocates separating data from behavior, and is strongly opposed to OOP in general.
Re:OOP Is Dead, Long Live OOP
by LiterallyDoge on Thursday October 18, 2018 @03:17PM
(#18251279)
Just so I understand you right: they're advocating global functions to operate on predictably similar data structures? If that's the case, it seems like you'd want some of them to be object-oriented, and some not.
Each system tends to operate on different sets of data which don't tend to be very similar, and systems may operate on multiple data sets.
You could build each system as an object, but you wouldn't want to store the relevant data structures within that object because other systems will likely need to use those data structures as well.
The entire architecture is predicated on separating data and behavior. Yes you can build an ECS system using classes, but nothing about it fits into what you'd call OOP.