Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Message from discussion how private is private in ruby?

View parsed - Show only message text

Path: g2news1.google.com!news4.google.com!news2.volia.net!news.germany.com!news.osn.de!diablo1-ffm.news.osn.de!noris.net!not-for-mail
From: Edward Faulkner <e...@alum.mit.edu>
Newsgroups: comp.lang.ruby
Subject: Re: how private is private in ruby?
Date: Thu, 27 Oct 2005 04:45:40 +0900
Lines: 41
Message-ID: <20051026194255.GD2269@peaches-en-regalia>
References: <3224.1130355152@www78.gmx.net>
NNTP-Posting-Host: sinus.lauschmusik.de
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="BRE3mIcgqKzpedwo"
X-Trace: ork-un.noris.net 1130355993 22591 213.95.32.201 (26 Oct 2005 19:46:33 GMT)
X-Complaints-To: news@noris.net
NNTP-Posting-Date: Wed, 26 Oct 2005 19:46:33 +0000 (UTC)
X-received-from: This message has been automatically forwarded from
   the ruby-talk mailing list by a gateway at lauschmusik.de. If it is
   SPAM, it did not originate at lauschmusik.de. Please report the 
   original sender, and not us. Thanks!
   Please see http://hypermetrics.com/rubyhacker/clrFAQ.html#tag24 to.
In-Reply-To: <3224.1130355152@www78.gmx.net>
X-ML-Name: ruby-talk
X-Mail-Count: 162806
X-ruby-talk: <20051026194255.GD2269@peaches-en-regalia>
X-rubymirror: yes

--BRE3mIcgqKzpedwo
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Oct 27, 2005 at 04:32:36AM +0900, Peter Ertl wrote:
> Why is this allowed / possible?
> $ puts ks.send(:key)
>
> so I can just use [public] for _everything_ as well, right?

While it may or may not be a good idea that #send subverts access
control, your choice of example betrays a misunderstanding of the
meaning of "private".

"private" is not intended as a security measure.  It's an
encapsulation technique.  You'll find this is generally true in other
languages as well.  You can certainly subvert "private" in C++.

"private" exists only to tell other programmers which methods they
really shouldn't be calling. =20

regards,
Ed

--BRE3mIcgqKzpedwo
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDX9w/nhUz11p9MSARAoseAKDJs++0QGFFQNAFdi09ZtjC5G9v5QCfeXDA
cgwtpmBtEyFhkla6OMp+Bvk=
=sHvJ
-----END PGP SIGNATURE-----

--BRE3mIcgqKzpedwo--



Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google