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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e67a94e45ae33316 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-09-05 14:49:24 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn4feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3B969DFA.414FAB0@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Another good URL for all you C++ haters References: <3b9604b1.10736828@news.geccs.gecm.com> <87u1yhmitg.fsf@deneb.enyo.de> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Wed, 05 Sep 2001 21:49:24 GMT NNTP-Posting-Host: 12.86.36.99 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 999726564 12.86.36.99 (Wed, 05 Sep 2001 21:49:24 GMT) NNTP-Posting-Date: Wed, 05 Sep 2001 21:49:24 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:12776 Date: 2001-09-05T21:49:24+00:00 List-Id: Florian Weimer wrote: > > chris.m.moore@amsjv.com (Chris M. Moore) writes: > > > Even Floyd, who loves the language, admits that, "Its greatest > > weaknesses is a flaw in the interface/implementation separation. A > > class exposes its private data/methods to the world and a programmer > > must use some tricks (that should be supported directly in the > > language) to overcome this." > > Doesn't have Ada a similar problem? Similar but not quite as severe. Ada private data and subprograms are what C++ calls "protected" data/methods. Ada's eqivalent to C++ private data/methods is data and methods defined in a package body but not in the specification. C++ public, private, and protected data and functions are normally declared in a header file. Functions are then defined in the .CPP (source) file. There is no automatic enforcement of separation of implementation and interface in C++. The entire implementation can be placed in the C++ header file. As with so many other C++ features, only good practice can produce good separation of interface and implementation. Compare both C++ and Ada to Java. Most Java classes are defined without benefit of an interface. In fact, Java interfaces are most typically used to define a call-back interface rather than to define common classes. Java does not even provide you the choice of using a header file. Java fans proclaim a lack of separation of interface and implementation to be an advantage because you have less code duplication. Jim Rogers Colorado Springs, Colorado USA