Quantcast
Channel: Stack Exchange – Ars Technica
Viewing all articles
Browse latest Browse all 40

Why is multiple inheritance so abhorred?

$
0
0

Panzercrisis asks:

I've always liked the idea of having multiple inheritance supported in a language. Most often though it's intentionally forgone, and the supposed "replacement" is interfaces. Interfaces simply do not cover all the same ground multiple inheritance does, and this restriction can occasionally lead to more boilerplate code.

The only basic reason I have ever heard for this is the diamond problem with base classes. I just can't accept that. To me, it comes off an awful lot like, "Well, it's possible to screw it up, so it's automatically a bad idea." You can screw up anything in a programming language though, and I mean anything. I just cannot take this seriously, at least not without a more thorough explanation.

Read full article

Comments


Viewing all articles
Browse latest Browse all 40

Trending Articles