The year is 2019
XavierAP
n3minis-git at yahoo.es
Sat Jul 27 10:54:21 UTC 2019
On Saturday, 27 July 2019 at 08:32:07 UTC, Mike Franklin wrote:
>
> but what I'm proposing is NOT multiple inheritance. It is
> simply struct composition as it should be.
Ah well I was referring to simple plain old inheritance, so it'd
be a separate topic/DIP. My question was whether a DIP about
simple struct inheritance, and I interpreted Manu's past thread
as requesting this (possibly among or together with other
features); but I had misunderstood at least the former.
> We keep espousing "prefer composition over inheritance" but
I see the point in that statement, but I don't subscribe 100%.
There's a pitfall in inheritance when you make too complex
hierarchies, that are too inflexible to redesign. In this case if
you had implemented the same from composition (e.g.
entity-component-system architecture) it would be more
flexible/better.
But those cases don't mean imo that inheritance is anathema or
never useful. Every feature can be abused (even templates, or
metaprogramming ;)
> I think D can be the first language to finally do composition
> right with this feature.
Sounds interesting.
More information about the Digitalmars-d
mailing list