is python Object oriented??

Russ P. Russ.Paielli at gmail.com
Wed Feb 4 10:53:54 EST 2009


On Feb 4, 5:35 am, Luis Zarrabeitia <ky... at uh.cu> wrote:
> Quoting "Russ P." <Russ.Paie... at gmail.com>:
>
> > Imagine you own a company, and you decide to lease an office building.
> > Would you expect the office doors to have locks on them? Oh, you
> > would? Why? You mean you don't "trust" your co-workers? What are locks
> > but enforced access restriction?
>
> This analogy is nonsense. There is no way you will execute code on my system if
> I don't authorize it, regardless of how "public" are the variables declared in
> my code. No one will execute code on _your_ system either, without your
> authorization. That puts you in a different position: you can easily _check_
> that everything is alright before executing, whereas in the office example, it
> cannot be done.

I don't follow your point, but I think you are reading too much into
the analogy. Obviously, an office building cannot be "copied" in a few
seconds as a software library can, so the analogy obviously cannot be
taken too far.

The locks on the doors are analogous to enforced access restrictions.
When you lease the building, you are presumably given a complete set
of keys, including master keys. The keys are analogous to the source
code, which allows you to trivially disable the access restrictions.

People like you are saying that keys are not enough. You don't want to
be bothered with keys. You want the office doors to come with no locks
on them at all, because you don't intend to lock them anyway, and
someone could possibly get locked out someday. You are saying that
locks are unnecessary because you trust your co-workers (aren't you
lucky!), and you can just put "keep-out" signs on the doors (leading
underscores).

Well, that may be reasonable for a small group of developers working
on a small, "cool" project. It is inappropriate, however, for a large,
safety-critical project with dozens or hundreds of developers that are
hired off the street in accordance with current labor laws. Now, if
you concede that Python is just not intended for such projects, then
fine, but please don't claim that access restrictions are useless for
all applications and domains. That's just ridiculous.



More information about the Python-list mailing list