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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,46b760ffb623378c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!npeer03.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!cyclone1.gnilink.net!gnilink.net!wn14feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: Hiding the value of Constants Reply-To: anon@anon.org (anon) References: <30696d63-16e8-44e2-a4a5-db5095d7cfec@m3g2000pri.googlegroups.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: <_kh7m.114839$d36.1919@bgtnsc04-news.ops.worldnet.att.net> Date: Wed, 15 Jul 2009 09:30:34 GMT NNTP-Posting-Host: 12.65.42.18 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1247650234 12.65.42.18 (Wed, 15 Jul 2009 09:30:34 GMT) NNTP-Posting-Date: Wed, 15 Jul 2009 09:30:34 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:7069 Date: 2009-07-15T09:30:34+00:00 List-Id: As for the client, they normally never looks at any part of the source code. They save that job for their IT or programmer that is maintaining the code for them. The exception may be when the code is a library, where the code could be use by other programmers, but if the code is open source or under the GPL all they need to do is check either the body or specification file aka no hidden value. So, anyone that uses the word "Hide" or varying of the word "Hide" is taking about closing the source or information from the client or other programmers. And many who ask about hidding values also ask about open/close source or the GPL, if you check their post. They want to hide the code from other programmer, hopely its a legal reason. And the original poster did not say anything about using the private section. In , "Ed Falis" writes: >On Sat, 11 Jul 2009 17:53:15 -0400, anon wrote: > >> In the years, there has been a few people asking how to hide values or >> constant. >> Some say use private which the value is still known. Others say use >> functions >> which can be hidden by removing the source code of the body of the >> package, >> but requires a call runtime routine each time the value is needed. >> >> But the main problem is that each person who wants to hide a constant >> forgets >> is that all someone has to do is to write a simple program to print the >> value. >> So, except to may be getting bonus points from a prof, its a waste of >> time. >> >> In my example I just showed a third way. To initialize the value at the >> Elaboration time instead of compile or using main runtime. >> >> You need to spead your weekends learning a few ticks of the trade about >> Ada. >> The program works. Just play with it, you might learn that using >> functions or >> private section to hide a value is not the only way. > >"Information Hiding" is not about hiding information from programmers. >It's about removing details that are irrelevant to clients of an interface >to services, in order to give more flexibility to the implementation of a >service and to make the client code's view of the service as essential as >possible. This reduces the need to rewrite client code when the >implementation of a service is modified. Tucker Taft had a way of >characterizing the difference between the public and private parts of >package specs that I still find appealing: the public part presents the >logical interface to client code; the private part presents the physical >part of the interface that is needed by the compiler for it to be >efficient (or to deal with extra-language representation issues). This >can be contrasted with more extreme approaches to "information hiding" >that use opaque types in the overall spec, deferring all detail to the >package body (and so invoking extra indirections). > >- Ed