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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,5af5c381381ac5a7 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!r27g2000yqb.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Ada requires too much typing! Date: Mon, 7 Jun 2010 05:17:16 -0700 (PDT) Organization: http://groups.google.com Message-ID: <03f84a0a-e070-43a9-9b68-920345f64f94@r27g2000yqb.googlegroups.com> References: NNTP-Posting-Host: 137.138.182.236 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1275913036 29105 127.0.0.1 (7 Jun 2010 12:17:16 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 7 Jun 2010 12:17:16 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: r27g2000yqb.googlegroups.com; posting-host=137.138.182.236; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:12376 Date: 2010-06-07T05:17:16-07:00 List-Id: On 7 Cze, 11:25, "Martin Krischik" wrote: > > Considering the performance aspect, the layout of variables within the > > object is determined *statically* [...] > Interesting opinion. Say we have [...] You are right here, I got confused by the low-level implementation details. There must be a run-time component of the access method for instance variables from virtually inherited classes. Mea culpa. I will still take the opportunity to twist my mistake :-) - take it as a proof that I have never explicitly used virtual inheritance in professionally written code, even though I *have* used multiple inheritance occasionally. Guess what - the default mechanisms always worked as I intended - this might be an indication that the whole problem is not nearly as dramatic as you portray it. In other words, I disagree with your statement that the behavior of C+ + in this area should be different. > > Again, that knowledge would not necessarily help them, as the use of > > virtual inheritance is not automatically justified. > > Like the use if virtual destructors is not automaticly justified? That's right. > Only: =A0 > count in your source the amount virtual destructors vs. non virtual =A0 > destructors. OK. Let's take something publicaly verifiable: the YAMI4 project, which contains some amount of C++ code (analyzed header files): - All destructors: 28 - Virtual ones : 6 Let's take the SOCI project for comparison: - All destructors: 61 - Virtual ones : 20 It looks like virtual destructors amount for some 20-30% of all in my code. > Why is what you need most not default? I find that what C++ offers in this area is what I need most of the time. Now I even have the scientific and statistical proof for this, as before this discussion I did not even know the real numbers. :-) I don't claim that my experiences are representative, but I will take the risk to claim that if you need all or most of your destructors to be virtual, then you are probably trying to write Java in C++. Now, to bring this discussion at least a bit back on topic, I think that Ada could offer similar mechanisms as C++. The reason is that the object model in both languages is very similar and in both cases based on value semantics. In particular, I find it a nuisance that controlled types must be tagged. -- Maciej Sobczak * http://www.inspirel.com YAMI4 - Messaging Solution for Distributed Systems http://www.inspirel.com/yami4