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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d10596e187e90822 X-Google-Attributes: gid103376,public From: Richard D Riehle Subject: Re: Private Children Date: 1999/06/24 Message-ID: <7ktrvn$l84@dfw-ixnews19.ix.netcom.com>#1/1 X-Deja-AN: 493454235 References: <7klja3$c0p$1@nnrp1.deja.com> <376E70A5.F77E558D@averstar.com> <376E9EEB.322A3F39@averstar.com> <7kmoe4$o83@dfw-ixnews15.ix.netcom.com> <7kr4pc$bb9@dfw-ixnews15.ix.netcom.com> <7kra6p$t5h$1@remarQ.com> <7krq1m$m2@dfw-ixnews5.ix.netcom.com> Organization: Netcom X-NETCOM-Date: Thu Jun 24 1:04:39 PM CDT 1999 Newsgroups: comp.lang.ada Date: 1999-06-24T13:04:39-05:00 List-Id: In article , Hyman Rosen wrote: >In C++ we can do the following. I'm not sure if I've duplicated the >semantics you're aiming for, but I think I did. Unless I'm not >understanding your intent, I don't see why my C++ is any more >difficult than your Ada. > >class P >{ >private: > class Item; > typedef Item *Item_Pointer; >public: > class T > { > public: > // operations on T > private: > Item_Pointer Data; > }; >}; I would first refer you to Mr. Freeman's article since he has more eloquently examined this issue than I. A key difference between C++ and Ada is that Ada _requires_ a separation of specification from implementation. This is also true, for the most part, of the Modula series. Although the semantics of an opaque type can be expressed in C++, I believe the best and most direct expression of this mechanism is found in Modula-3, then Ada, and lastly other languages, such as C++. The argument about whether a particular construct _can_ be expressed in this or that language is often far from the issue of direct expressibility. There are certain things that are more expressible in C++ than Fortran, others more expressible in Fortran than C++, and still others better expressed in COBOL than in C++ or Java. There are ideas we can express in a single word in Japanese or Chinese that might take a paragraph in English. This does not make Japanese better than English. It is simply a matter of ease of expressibility. Also, the issue of expressive power is quite subjective and almost always derives from one's personal preferences and experiences, seldom from faultless logic. I am sure there are Ada enthusiasts who will disagree with my contention that Modula-3 is better at expressing opaque types than Ada. Overall, my language preference still remains Ada, even though C++, Java, Modula-3 and Object COBOL all have features of expressiveness for certain constructs that are better than a similar construct in Ada. Richard Riehle richard@adaworks.com http://www.adaworks.com