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-Thread: 103376,78609accbfa860fe X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!y1g2000pra.googlegroups.com!not-for-mail From: Graham Stark Newsgroups: comp.lang.ada Subject: Re: usefulness of "data hiding" Date: Sun, 18 Jan 2009 05:07:40 -0800 (PST) Organization: http://groups.google.com Message-ID: References: <72f07ba4-f06d-44bf-9759-0e6f0d0426d0@h20g2000yqn.googlegroups.com> NNTP-Posting-Host: 86.130.78.66 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1232284061 9198 127.0.0.1 (18 Jan 2009 13:07:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 18 Jan 2009 13:07:41 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: y1g2000pra.googlegroups.com; posting-host=86.130.78.66; posting-account=04rmagoAAABZ9PN7u3MdbKIs6DPG57E- User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.04 (hardy) Firefox/3.0.5 Ubiquity/0.1.5,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:3425 Date: 2009-01-18T05:07:40-08:00 List-Id: On Jan 16, 8:57=A0am, "Dmitry A. Kazakov" wrote: > On Thu, 15 Jan 2009 16:51:38 -0800 (PST), Russ P. wrote: > > As many of you probably know, Python had no data hiding. > > Python is a dynamically typed language. When dynamic typing is considered > conceptually that inevitably leads you to weak and then to no typing. In = an > effectively untyped framework (this includes massive type inference as > well), you necessarily have to drop encapsulation. There is nothing to > hide, and nothing can be hidden. > There's not much relationship between weak typing and data hiding, is there? The least strongly typed language I know of is PHP ($s =3D "x" + 10; is legal, for instance) but you can have complete encapsulation if you want it: class A{ private $a; function getA(){ return $this->a; } function setA( $a ){ $this->a =3D $a; } } and there are strongly typed languages, like Pascal, where you can't do this at all. Graham > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de