From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.2 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 38CEBBB84 for ; Sat, 17 Jan 2009 15:07:23 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiIDAA91cUlDWxLCbmdsb2JhbACBbJIYPqphhimGVoVz X-IronPort-AV: E=Sophos;i="4.37,280,1231110000"; d="scan'208";a="33879611" Received: from ip67-91-18-194.z18-91-67.customer.algx.net (HELO server1.bertec.net) ([67.91.18.194]) by mail4-smtp-sop.national.inria.fr with ESMTP; 17 Jan 2009 15:07:22 +0100 Received: from [IPv6:::1] (server2.bertec.net [192.168.2.6]) by server1.bertec.net (Postfix) with ESMTP id 339AD1056C4 for ; Sat, 17 Jan 2009 09:07:19 -0500 (EST) Message-Id: From: Kuba Ober To: caml-list@yquem.inria.fr In-Reply-To: <23738f080901161914tb290576yd2306babe68887ea@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v930.3) Subject: Re: [Caml-list] C++/C# inheritance is bad? Date: Sat, 17 Jan 2009 09:07:19 -0500 References: <91a2ba3e0901161027x5432afcbh504b4ca3df501851@mail.gmail.com> <23738f080901161914tb290576yd2306babe68887ea@mail.gmail.com> X-Mailer: Apple Mail (2.930.3) X-Spam: no; 0.00; model:01 ocaml:01 model:01 yaron:01 runtime:01 polymorphism:01 cheers:01 wrote:01 caml-list:01 face:97 inheritance:03 static:03 limitations:04 complain:04 perhaps:05 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