2 ms·
> In school I learned about inheritance, not composition. And that's perfectly fine, provided that students learn that trying to do downcasts like casting an a
by arinlen 4y ago
> In school I learned about inheritance, not composition.
And that's perfectly fine, provided that students learn that trying to do downcasts like casting an animal instance to a dog instance is something that in general never made any sense, and more often than not reflects ignorance.
> This way of doing things necessitates downcasting;
Not true. That way of doing things necessitates ignorance of basic concepts across many domains, including basic OO programming in general and C++ in particular. You can't blame the tool of your choice for problems you create out of ignorance and failing to think things through.