Why Multiple Inheritance Is Dangerous
Allowing Multiple Inheritance Makes the Rules About Function Overloads and Virtual Dispatch Decidedly More Tricky, as Well as the Language Implementation...
Allowing multiple inheritance makes the rules about function overloads and virtual dispatch decidedly more tricky, as well as the language implementation around object layouts. These impact language designers/implementors quite a bit and raise the already high bar to get a language done, stable, and adopted.
What are the disadvantages of multiple inheritance?
- Complex structure, complex relationship between classes.
- Classes with complex parent classes with vague priorities are difficult to identify at once.
- Functional conflicts occur when the same method exists in different parent classes.
What is advantage and disadvantage of multiple inheritance?
“Multiple inheritance is the process where a subclass can be derived from more than one super-class. Its advantage is that a class can inherit the functionality of more than one base class, but its disadvantage is that it can lead to a lot of confusion when two base classes implement a method with the same name.”