News for hackers. Stuff that matters.
Re:The Invisible Bunnies That Power World of Warcraft (2017) by baq on Monday December 11, 2023 @02:17AM (#38598370)
ECS is IMHO a logical consequence of observing that game worlds are not object oriented (as it is taught in schools, so class hierarchies etc.) Add a sprinkle of performance requirements and you get what is understood as ECS frameworks.

…but it turns out that the ‘world is not made of class hierarchies’ observation is not limited to games, hence Rust’s and go’s approaches to OOP: ditch inheritance at the language level.

Re:The Invisible Bunnies That Power World of Warcraft (2017) by dale_glass on Monday December 11, 2023 @02:58AM (#38598547)
The world isn't, but some things are. Doesn't Rust have a problem with GUI frameworks because they heavily use inheritance?
Re:The Invisible Bunnies That Power World of Warcraft (2017) by s-lambert on Monday December 11, 2023 @03:32AM (#38598700)
I don't think it does, I think Rust GUI frameworks have the same problem as Rust game engines, there's more people making frameworks than people actually making applications. They mostly seem to be going in the same direction as web UI frameworks though, which don't use much inheritance either.
Re:The Invisible Bunnies That Power World of Warcraft (2017) by seanalltogether on Monday December 11, 2023 @06:52AM (#38599790)
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.
Re:The Invisible Bunnies That Power World of Warcraft (2017) by baq on Monday December 11, 2023 @07:59AM (#38600251)
E.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.

Re:The Invisible Bunnies That Power World of Warcraft (2017) by Coder1996 on Monday December 11, 2023 @11:53AM (#38602217)
I 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.

Re:The Invisible Bunnies That Power World of Warcraft (2017) by baq on Monday December 11, 2023 @12:17PM (#38602424)
> 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.

Re:The Invisible Bunnies That Power World of Warcraft (2017) by Coder1996 on Tuesday December 12, 2023 @11:10AM (#38614090)
I 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?