What are the prominent downsides of the D programming language?

mw mingwu at gmail.com
Tue Sep 29 22:45:02 UTC 2020


On Tuesday, 29 September 2020 at 22:18:52 UTC, H. S. Teoh wrote:
> On Tue, Sep 29, 2020 at 10:02:28PM +0000, Jean-Louis Leroy via 
> Digitalmars-d wrote:
>> On Tuesday, 29 September 2020 at 21:43:03 UTC, mw wrote:
>> > The key idea is to treat each parent's class attributes 
>> > individually (via rename/undefine/redefine/select) instead 
>> > of as in other multiple inheritance languages, e.g. C++'s 
>> > all-or-none approach, i.e. either all the parents' 
>> > attributes are shared or separated, and even when separated, 
>> > there is no proper renaming mechanism to handle it.
>> 
>> If Base has features f and g, and Derived inherits from Base 
>> but undefines g, I assume that a Derived object cannot be 
>> substituted for a Base. Correct?
>
> This would break Liskov Substitution, wouldn't it?

No, it just become abstract method, and class.

> {methods,fields,etc.} from the base class and arbitrarily 
> modifying them to produce a new object that may or may not even 
> substitute for the base class anymore in the Liskov sense.

Can you study the language behavior before making such comments?

This language won the ACM system software award!

> I mean, sure, being able to undefine/redefine base class 
> members is all nice and everything, but it's very hard to 
> reason about.

It's very easy, and nature to reason about it:

undefine a method Derived.foo() ==> Derived.foo() now becomes an 
abstract method.


Please see my previous reply.  And try it yourself:

https://github.com/mingwugmail/dlang_tour/tree/master/eiffel/mi



More information about the Digitalmars-d mailing list