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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,93d7def3eeefbc26 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!z14g2000cwz.googlegroups.com!not-for-mail From: danmcleran@hotmail.com Newsgroups: comp.lang.ada Subject: Re: Private area and child packages Date: 31 Dec 2004 19:45:52 -0800 Organization: http://groups.google.com Message-ID: <1104551152.044769.314670@z14g2000cwz.googlegroups.com> References: <1104333056.340127.5170@f14g2000cwb.googlegroups.com> NNTP-Posting-Host: 172.130.196.55 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1104551156 29522 127.0.0.1 (1 Jan 2005 03:45:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 1 Jan 2005 03:45:56 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: z14g2000cwz.googlegroups.com; posting-host=172.130.196.55; posting-account=LSix6gsAAACmBFWMCbh6syCaua0lawvj Xref: g2news1.google.com comp.lang.ada:7367 Date: 2004-12-31T19:45:52-08:00 List-Id: tmoran@acm.org wrote: > You could burn the only copy of the source code. Seriously, how > else could you enforce such a restriction on future developers who > want to fiddle with/fix your code? Isn't that what abstraction and encapsulation is all about? In your designs, do you make eveything public because it can be done that way by some future developer anyway? > Even if the compiler would > allow such a limit (say by disallowing child packages) what would > prevent someone from simply modifying your code, say by moving the > "hidden" declaration from the private to the public part of the spec? If you take this argument to its logical extreme, then all of the time and effort that has gone into creating programming languages to provide features such as abstraction & encapsulation has been a giant waste of time. Since anyone could always make private data public any time they choose, why not just stick with assembly language(s) or C? Why not just make everything public all of the time? > Or, if they can't modify your code, but can find a copy of the source > somewhere, they could declare their own structure to match yours, and > use an address clause to overlay their (visible) structure over yours. This seems like a pretty far-fetched counter-argument. > Part of the Ada Style is a certain humility. Assuming that your > code and your design is so perfect that any change by anyone in the > future is bad, is unwise, as shown by much sad experience. IMHO I would agree, but I would also argue that it is in the best interests of a good software design to only expose what is absolutely necessary to be exposed.