Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: Kuba Ober <ober.14@o...>
Subject: Re: [Caml-list] C++/C# inheritance is bad?

On Jan 16, 2009, at 10:14 PM, Sashan Govender wrote:

>>
>> I basically still hold that Yaron's original objection is baseless  
>> in face
>> 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.
>
> I thought he was talking about the effects of runtime polymorphism on
> static code analysis. You can't tell which method is invoked if the
> method is virtual.

That's fine, because if your code is written well it doesn't matter at
all which one it is. All you care about is the interface and not the
particular implementation -- assuming that all implementations adhere
to the interface. Such adherence can be checked in isolation from
where the method is used. That's a separation of concerns in
code verification and is perhaps a good thing.

Cheers, Kuba