Python Productivity over C++ (Encapsulation)

Derek Thomson derek at ooc.com.au
Thu Jun 15 15:40:42 EDT 2000


Hung Jung Lu wrote:
> 
> --- In python-list at egroups.com, Ken Seehof <kens at s...> wrote:
> >"Frank V. Castellucci" wrote:
> > > Courageous wrote:
> > > While the last line seems rather toungue in cheek, there are other
> > > things that C++ brings to the table such as encapsulation, access
> > > control and type strictness.
> >Encapsulation, access control and type strictness are often erroneously
> >referred to as if they were features.  They aren't.  They are aspects of a
> >design philosophy.  To make a system less error prone, constrain the
> >programmer
> >in order to prevent the programmer from writing bugs.  ...
> >You have to ask, "what is the actual value of these features?"  The answer
> >is
> >that they prevent certain kinds of bugs from appearing.
> 
> Type strictness is fine. It has all to do with performance: small, fast,
> efficient machine code. Encapsulation is a totally different story.
> 
> One of the biggest lies in modern computer language theory is that
> encapsulation is there for a good technical reason.

Yes, it is there for a good technical reason. 

>
> [Delete ranting]
> [Summary: Lack of "private" keyword in small but nice programming language >  brings love, peace and unlimited rice pudding to all.
>  Evil corporations crumble to dust instantly to be replaced by nice,
>  clean socialist re-education camps]
> 
> I just don't see how those little white lies can perpetuate after Visual
> Studio 7.0 incorporates Visual Python. Sleepyheads will wake up, and the
> corporate tower will start to collapse. Not a bad thing. :)

Then why does Python support encapsulation that is just as strict as C++? Guido
van Rossum - exposed as a traitor to the people's revolution all along!

I can easily subvert encapsulation in many C++ classes simply with the line
"#define private public" before I include any header files. Perhaps this means
that C++ will in fact lead to the overthrow of evil and oppression in the world?

Also, remember that Java's encapsulation isn't exactly inviolable. It can't be.
Think about it.

The only real way to implement the kind of encapsulation that you are talking
about is to run the objects on a different server, and specify access in CORBA
IDL, or a well defined socket protocol. And there are certainly very good
technical reasons (that don't involve actual world domination by shadowy evil
overlords) for doing this.

Regards,
Derek.



More information about the Python-list mailing list