What are the prominent downsides of the D programming language?

Abdulhaq alynch4047 at gmail.com
Mon Sep 21 10:25:02 UTC 2020


On Monday, 21 September 2020 at 09:35:10 UTC, Ruby The Roobster 
wrote:
> On Monday, 21 September 2020 at 09:29:21 UTC, Tomcruisesmart 
> wrote:
>> Hi,
>> I'm looking for healthy conversation.
>> What are the prominent downsides of the D programming language?
>
> One downside is that classes can't inherit from multiple 
> classes.
>  I know that there is a thing called an interface which a class 
> can inherit more that one of those. Thing is, functions in 
> interfaces have to be abstract.  Also, member variables 
> declared in an interface have to be static, and the only member 
> functions that are defined have to be static. Why can't we just 
> inherit from multiple classes?

Multiple inheritance would really complicate the language, and 
it's benefits are held not to be sufficient to outweigh the 
downside of that.

Another very important thing to bear in mind is to prefer 
composition over inheritance - a simple maxim but very very true 
(IMO). Google it for more details.

In the seventies and eighties oject orientation was very 
fashionable and books like "Learn C++ in 24 hrs" were mainly 
filled with the complexities of inheritance. This made us think 
that inheritance was the preferred way to share functionality 
between classes of objects. As it turns out, it's not (IMO).


More information about the Digitalmars-d mailing list