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,b3e32a261c552ef1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-11 21:14:21 PST Path: supernews.google.com!sn-xit-02!supernews.com!216.227.56.88.MISMATCH!telocity-west!TELOCITY!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!xfer13.netnews.com!netnews.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3A35B45D.5F05F171@acm.org> From: Jeff Carter X-Mailer: Mozilla 4.7 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada OOP question References: <20001209101904.07653.00004016@ng-fy1.aol.com> <3A32A182.54E3D857@acm.org> <91382k$nq1$1@nnrp1.deja.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 12 Dec 2000 05:14:16 GMT NNTP-Posting-Host: 165.121.233.185 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 976598056 165.121.233.185 (Mon, 11 Dec 2000 21:14:16 PST) NNTP-Posting-Date: Mon, 11 Dec 2000 21:14:16 PST Organization: EarthLink Inc. -- http://www.EarthLink.net Xref: supernews.google.com comp.lang.ada:2978 Date: 2000-12-12T05:14:16+00:00 List-Id: mark_lundquist@my-deja.com wrote: > Baloney! How is mixing public and private any more EVIL than having > all components public, which Ada makes no more difficult than any other > language? Arguably, if one feels that some component of an abstraction > must be public, it's still better to have the rest private than to make > all public, wouldn't you say? I think one could make a case that > public components in general are about the same level of evilness as > goto, i.e. easy to abuse, but also easy enough not to abuse, and the > abuse is of a kind that is more a consequence of bad design than a > cause. You have presented no evidence to support your claim of baloney. Salami, perhaps. Seriously, I was employing hyperbole in describing it as EVIL. However, I think that this practice should be discouraged. The problem is that such a type creates an interface that is difficult to understand. What is the difference between Op (Object, Param1, Param2); and Object.Public_Component := Some_Value; Op (Object, Param1, Param2); ? They could be the same; Op could perform differently in the 2nd case, but this be considered valid; or Op could be invalid as a result of the assignment. This doesn't bother C++ people, who expect the client to read the implementation to learn how to use a type. Frequently such components are used both to shorten parameter lists and store state between calls. In general, visible components in an abstraction are a bad idea, including when they are all visible: you cannot change the implementation without changing the interface. -- Jeff Carter "I blow my nose on you." Monty Python & the Holy Grail