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.5 required=5.0 tests=AWL,DNS_FROM_RFC_ABUSE, 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 70AC8BB84 for ; Fri, 16 Jan 2009 22:42:40 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmMZADOOcElDWxLCYGdsb2JhbACBbJIOHiqrf4YnhkaFcg X-IronPort-AV: E=Sophos;i="4.37,278,1231110000"; d="scan'208";a="33859525" 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; 16 Jan 2009 22:42:39 +0100 Received: from pc54.bertec.net (pc54.bertec.net [192.168.2.54]) by server1.bertec.net (Postfix) with ESMTP id D15341056C4 for ; Fri, 16 Jan 2009 16:42:36 -0500 (EST) Message-Id: From: Kuba Ober To: caml-list@yquem.inria.fr In-Reply-To: <91a2ba3e0901161027x5432afcbh504b4ca3df501851@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: Fri, 16 Jan 2009 16:42:36 -0500 References: <91a2ba3e0901161027x5432afcbh504b4ca3df501851@mail.gmail.com> X-Mailer: Apple Mail (2.930.3) X-Spam: no; 0.00; subtyping:01 -like:01 model:01 model:01 ocaml:01 yaron:01 cheers:01 disturbing:98 wrote:01 caml-list:01 substitution:01 purely:02 implemented:02 face:97 theoretical:03 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: > > http://alistair.cockburn.us/Constructive+deconstruction+of+subtyping Good paper, but doesn't directly address the issue of good practice in C++-like languages. > http://www.dbdebunk.com/page/page/626998.htm This is a great discussion, but it's purely theoretical. The author simply 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 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. Cheers, Kuba