[Zope] Zope needs this (and Dynamo has it)

Hung Jung Lu hungjunglu@hotmail.com
Sat, 11 Mar 2000 18:18:59 PST


>alexander staubo <ale-@mop.no> wrote: > I think Zope's source code is one 
>huge, glowing argument in favour of
> > having protected members.

Having worked with C++ for a long time, and later with Java,
I can tell you just how much I hated the whole thing about
data "encapsulation."

The whole mumbo-jumbo stuff about data hiding has one and one
single purpose: divide the programmers into engine programmers
and app programmers, so the engine programmers and exercise
full control over app programmers. It has more to do with
MONEY and corporate POWER CONTROL than with technology.
The private/protected keywords are an enterprise feature...
designed for big companies.

And generations of students are taught into this stupid
c**p about "data encapsulation." Funny thing is, many actually
buy the idea, get burnt for a few years and refuse to
acknowledge they are being burnt ("if it is mentioned in
textbooks, there must be a reason... it must be good for me..."),
and only then to realize much later... hmmm.... maybe
"data encapsulation" should be done by convention and not by
syntax.

> > Python has no "out" parameter, only "in" parameters that
> > are mutable depending on the type of the object passed. The syntax I'm
> > alluding to would effectively give you both "out" and "const"
> > parameters.
>But that might result in a lot of incomprehensible code. I'm not sure if 
>I'm in favor of having 'out' parameters anyway. constness as defined in
>C++ is also tricky, as it infects code; everything that touches it
>needs to be const-correct. Python tends to be less strict in this area.

Yes, another thing that I consider to be stupid in C++ is the
overuse of const, or its use at all. Again, generations of
programmers are taught into this thing about usage of const,
and buying into it without questionning.

Python uses references for object parameters in function calls.
It can also return tuples. That's enough. Really.

Keep Python simple. The role of Python is CP4E (Computer
Programming For Everyone.) In Java or C++, you have to type
all the extra stuff about public/ private/ protected/ void/
abstract/ static/ synchronize/ final/ const/... before you can
do something. I know many people that live in that world and
refuse to simplify their lives... well, then again, I also
know people that lives in the Perl world and insist that Perl
is a very readable language. :)

Hung Jung

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com