From: Graham Stark <graham.stark@virtual-worlds.biz>
Subject: Re: usefulness of "data hiding"
Date: Sun, 18 Jan 2009 05:07:40 -0800 (PST)
Date: 2009-01-18T05:07:40-08:00 [thread overview]
Message-ID: <c3c50c78-61f5-4961-bc6e-f8dcc71d625e@y1g2000pra.googlegroups.com> (raw)
In-Reply-To: o029wq1r5hym.1r8ep5ye1ieoi$.dlg@40tude.net
On Jan 16, 8:57 am, "Dmitry A. Kazakov" <mail...@dmitry-kazakov.de>
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 = "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 = $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
next prev parent reply other threads:[~2009-01-18 13:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-16 0:51 usefulness of "data hiding" Russ P.
2009-01-16 1:08 ` Russ P.
2009-01-16 1:33 ` Adam Beneschan
2009-01-17 19:05 ` Marc A. Criley
2009-01-19 16:15 ` Adam Beneschan
2009-01-16 8:57 ` Dmitry A. Kazakov
2009-01-16 23:23 ` sjw
2009-01-17 8:53 ` Dmitry A. Kazakov
2009-01-18 13:07 ` Graham Stark [this message]
2009-01-18 14:17 ` Dmitry A. Kazakov
2009-01-16 17:21 ` Nicholas Collin Paul Gloucester
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox