2

I know very well about the traditional arguments about why Interface Inheritance is prefered to multiple inheritance, there has been already a post here : Should C# have multiple inheritance?

But according to Stroustrup the real reason why Microsoft and Sun decided to get rid off multiple inheritance is that they have vested interest to do so: instead of putting features in the languages, they put in frameworks so that people then become tied to their platform instead of people having the same capability at a language standard level.

What do you think ?

Why Sun and Microsoft consider developers too immature to just make the choice themselves ?

Above is my explicit interpretation of what he said. Of course he did say that in a more politically-correct way :)

Excerpt from "A Conversation with Bjarne Stroustrup" http://www.artima.com/intv/modern.html

People quite correctly say that you don't need multiple inheritance, because anything you can do with multiple inheritance you can also do with single inheritance. You just use the delegation trick I mentioned. Furthermore, you don't need any inheritance at all, because anything you do with single inheritance you can also do without inheritance by forwarding through a class. Actually, you don't need any classes either, because you can do it all with pointers and data structures. But why would you want to do that? When is it convenient to use the language facilities? When would you prefer a workaround? I've seen cases where multiple inheritance is useful, and I've even seen cases where quite complicated multiple inheritance is useful. Generally, I prefer to use the facilities offered by the language to doing workarounds.

From "Interview of Bjarne Stroustrup by "Developpeur Reference""

http://www2.research.att.com/~bs/nantes-interview-english.html

You can always re-write an example using multiple inheritance into on the uses single inheritance only (by using forwarding functions). However, the result is often an example that is longer, reflect the design less directly, and is harder to maintain. Note that you can also rewrite every example using single inheritance to an example using no inheritance using the same technique and with the same negative impact on code clarity. A language that does not support multiple inheritance is simply less expressive than one that supports multiple inheritance and thereby forces the programmer to occasionally complicate code.

...

People talk a lot about frameworks, but history is littered with frameworks that didn't live up to their expectations. I have seen successful frameworks, but they were generally limited in scope. I'm skeptical of "universal" frameworks, and even more so when such frameworks are products of a platform vendor competing with similar frameworks from other vendors. As a user, I prefer to maintain my independence from vendors as far as possible.

I'd like to seen libraries providing cleaner and more general access to frameworks - as opposed to languages intimately tied to a single framework.

10
  • 1
    Citation needed, do you have a link to where Stroustrup said this? Apr 17, 2010 at 12:12
  • Argumentative ... mark as community wiki. Apr 17, 2010 at 12:13
  • As interesting as this is, it is definitely going to get closed as argumentative and subjective. Unless you can point to some source where Microsoft and Sun are seen to admit to Stroustrup's accusation against them - then I can't see that I disagree with that characterization of this question. Apr 17, 2010 at 12:13
  • FYI his name is spelled "Stroustrup". Apr 17, 2010 at 12:14
  • 1
    So BS says that MS and Sun's vested interests kept multiple inheritance out of their OO languages. What then do you think are his vested interests ? Apr 17, 2010 at 22:03

1 Answer 1

1

My own thought:

People do follow fashion and IT is no exception. Nobody dares to question the fundamentals until some Gurus have themselves interest to do so.

For example in the case of Java nobody dared to question EJB until Rod Johnson came along with another framework which he said was inspired by .NET pragmatism.

And now .NET is becoming itself more and more frameworklish with EF.

Not the answer you're looking for? Browse other questions tagged or ask your own question.