From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: backlog3.nntp.ams3.giganews.com!backlog3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!newsfeed.fsmpi.rwth-aachen.de!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: How to hide inherited implementation of a public interface? Date: Fri, 21 Mar 2014 18:02:28 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <1goz7i2pg8860.1kma3d5vz1fl$.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1395442948 3857 69.95.181.76 (21 Mar 2014 23:02:28 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 21 Mar 2014 23:02:28 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: number.nntp.dca.giganews.com comp.lang.ada:185280 Date: 2014-03-21T18:02:28-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:1goz7i2pg8860.1kma3d5vz1fl$.dlg@40tude.net... > On Fri, 21 Mar 2014 10:58:54 -0700, Jeffrey Carter wrote: > >> On 03/21/2014 05:53 AM, Natasha Kerensikova wrote: >>> >>> package I is >>> type T is interface; >>> procedure P (Object : in out T) is abstract; >>> end I; >> >> "IMHO, Interfaces are worthless." > > Interface is an abstract type. Abstract types are not worthless. > > Worthless is the Java's idea that multiple inheritance could become more > useful, less flawed, choose what you want, when restricted to interfaces. Exactly. "Abstract types" (which can have components, implementations, etc.) are not worthless. The restrictions on interfaces make them worth little. ("Worthless" is going a bit far, of course, but it makes a good sound bite.) The costs of multiple inheritance (which are considerable) make them not worth the effort. Full multiple inheritance CAN be implemented, but it's expensive enough in compiler and language complexity that the costs outweight the value. The halfway Java-like solution is easier to implement but makes no one happy. We should have told the multiple inheritance nuts to forget it, because it makes no sense for Ada. Randy.