What are the prominent downsides of the D programming language?

Mike Parker aldacron at gmail.com
Wed Sep 30 08:44:26 UTC 2020


On Wednesday, 30 September 2020 at 00:57:52 UTC, Jean-Louis Leroy 
wrote:

> There is a pattern that I have observed in my 30+ year career, 
> it's not easy to phrase it, but it goes something like this: 
> when I found MI handy, it was usually for mixing independent 
> technical aspects, not so much "modeling the real world". I 
> think that someone mentioned a Button that is both a Drawable 
> and a Clickable. This is the sort of things I have in mind. And 
> if you don't use MI you quickly get a god class that declares 
> dozens of facets, only a few of which are actually implemented 
> in classes scattered across the inheritance tree (think the 
> Microsoft Foundation Classes with its CObject god class).
>

I read a game development book[1] years ago where the author was 
pushing this approach quite strongly, saying he had published 
several games where it was used. He referred to it as "mixin 
inheritance". As long as you reserve MI for introducing behaviors 
into classes and constrain derived "is-a" relationships to a 
single (preferably shallow) line in the hierarchy, you are less 
likely to run into problems.

[1] 
https://www.amazon.com/Object-Oriented-Game-Development-Julian-Gold/dp/032117660X




More information about the Digitalmars-d mailing list