Multiple alias this, what's the hold up?
Mike Franklin
slavo5150 at yahoo.com
Sun Jun 16 23:58:49 UTC 2019
On Sunday, 16 June 2019 at 22:28:56 UTC, Walter Bright wrote:
>> I refer you to this StackOverflow question
>> (https://stackoverflow.com/questions/255553/is-it-possible-to-implement-mixins-in-c) where a C# user was looking for a convenient way to reuse and aggregate implementations. The second comment to the question says it all:
>>
>>> I find it annoying that C++ experts make statements like
>>> "Prefer composition to inheritance" yet the language (C++ or
>>> C#) offers precious little help to do the "right thing".
>
> Be careful about dismissing what experts say. Sometimes it
> takes many years of experience to understand that seemingly
> good ideas are not that good after all.
>
> I don't do use a lot of programming techniques I thought were
> way cool in my 20's, but now I understand are crap, like <cough
> cough>macros</cough cough>.
I think you may have misunderstood what that user and I are
saying. We're not dismissing what the experts say, in fact we,
for the most part, agree with them. What we're saying is that
the facilities for composition in C# and C++ are lacking, yet
those experts, disingenuously, aren't acknowledging it.
D has an opportunity, and is better positioned, to do better. If
C++ style multiple inheritances is not the answer, what is?
Eiffel's multiple inheritance? D's `alias this`?
Design-by-introspection metaprogramming? "Suck it up, and get
typing!"?
Mike
More information about the Digitalmars-d
mailing list