Migrating to perl?

Moshe Zadka moshez at zadka.site.co.il
Fri Jan 5 19:38:56 EST 2001


On Fri, 5 Jan 2001, "Joel Ricker" <joejava at dragonat.net> wrote:

> From your examples, Pythons class model is much cleaner.

Personally, I fell in love in Python because of the object model.

>  Also if I
> understand your example, variables internal to the object are kept
> internal -- they can't be accessed without a proper method.  With perl
> anything goes. 

Nope. In Python, anything goes, too. Most people assume that if they
write in the docs what methods are external, intellegient people will
use them.

> I've mentioned before that I'm real new to OO.  How should I approach it in
> Python?  Has anyone learned OO just from Python?  Or should I study OO
> theory else where and then apply it to Python?

I have very little respect for OO theory. Don't write OO in Python --
write simple Python. It will be OO, because the language encourages
you to. People naturally write classes in Python, because it's the 
easiest way. 

> I know this is bordering on
> the question of how do I do OO but I really know very little about it...

OO is not a holy grail. Getting your job done is the important thing.
Writing idiomatic Python will help you get your job done, and will
usually encourage you to use OO so subtly you won't know you're doing
it -- you'll only know you're doing something right.

> I heard something about curley braces as well.  No {} for blocks?  Thats
> going to take some getting used to :)

It took me about 10 minutes. I learned Python one evening, and wrote
the next morning programs that worked. Without bugs. The first
time. 

don't-think-of-python-as-the-other-side--think-of-it-as-the-
-only-side-ly y'rs, Z.
-- 
Moshe Zadka <sig at zadka.site.co.il>
This is a signature anti-virus. 
Please stop the spread of signature viruses!




More information about the Python-list mailing list