Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
C++/C# inheritance is bad?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-01-16 (21:42)
From: Kuba Ober <ober.14@o...>
Subject: Re: [Caml-list] C++/C# inheritance is bad?

On Jan 16, 2009, at 1:27 PM, Raoul Duke wrote:

>> the Liskov's substitution principle was violated. I have violated  
>> it myself
>> ...
>> So, when correctly applied, what's so disturbing about inheritance?  
>> You
> i like these food-for-thought / throw-gasoline-on-the-fire articles
> about the general subject:

Good paper, but doesn't directly address the issue of good practice in  


This is a great discussion, but it's purely theoretical. The author  
says that OO model as implemented in C++ is quite deficient and a good
OO implementation should not have its drawbacks. Fine and dandy, but
when you *do* use C++/Java/C#, that's what you've got, and if you try
to abuse it, you deserve what you get ;)

I basically still hold that Yaron's original objection is baseless in  
of established good OO practice in C++/Java/C#/...

I do understand the limitations of the popular OO model, of course, and
the benefits of Jane Street choosing OCaml. I was merely trying to
understand what I don't understand about the popular OO model that
would have Yaron complain about not being able to tell which exact
method is being called... It, somehow, is not an issue for me, not in
well designed C++ codebases at least.

Cheers, Kuba