by capableweb · 3y ago · 0 comments
And Bevy (one Rust game engine) makes it very easy to ignore much of the problems of Rust, as the architecture (ECS) and the implementation Bevy has of it, hides a lot of "warts" that you would have to battle with otherwise.
Bevy makes it really easy to learn Rust, at least that's what I've found when I picked up Rust first.
What Rust really skips is inheritance (although you can get partway there with trait dependencies), which I think is generally a good thing
In Rust we could make a Mimic by composing a Chest, and a Monster, and then implementing any traits on the resulting composite object appropriately, passing through to an underlying object in some cases -- opening this "Chest" ought to cause its status as a Monster to be revealed right?. In languages with single inheritance we need to decide, is a Mimic a Chest? Is it a Monster? Maybe all Chests are Monsters? Maybe all Monsters are Chests? In languages with multiple inheritance we can inherit from both, but we might find that isn't what we wanted either and there are likely to be conflicts from such a web of heritability.