Migrating to perl?

Joel Ricker joejava at dragonat.net
Fri Jan 5 00:47:32 EST 2001


Martijn Faassen wrote in message <933fa1$j2i$1 at newshost.accu.uu.nl>...

[*snip*]

>Joel Ricker <joejava at dragonat.net> wrote:
>> What about OOP?  Is it it a full OO language?
>
>Yes, Python does OOP just fine, and is a full dynamically typed OOP
language.
>If you are familiar with languages like C++ or Java you're in for a
>hopefully pleasant surprise; there is much less programmer overhead to
>create and use classes than there is in those languages, due to the
>simpler syntax, and dynamic typing instead of static typing.
>
>> Is it easier than to use than
>> perl?  Perl OO just feels like it has been cludged together.
>
>From my limited experience with Perl, definitely yes. I've been told Perl's
>OO model is actually inspired by Python's, but I didn't spend enough of
time
>with Perl's OO features to know much about that.


>From your examples, Pythons class model is much cleaner.  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.  There are some techniques to prevent this but it isn't
definite.  Its actually this very topic that made me throw my new OO book
across the room and subscribed to this newsgroup :)

>In python this is how you make a class:


[*snip -- OO example*]


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 know this is bordering on
the question of how do I do OO but I really know very little about it...
enough to know that I can benefit from it and basic ideas.  I understand the
idea of a class and building objects from it but anything beyond that is
still really new to me.  Any suggestions?

>The Python community's reputation is that it's friendlier than the Perl
>community, the flame war about variable initialization in the do..until
>thread notwithstanding. :)


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

>I've seen people beinn pleasantly surprised by the quality of answers
they've
>received in this newsgroup, so you may like it.


I know I have been.  Nothing like a friendly newsgroup to convince me to
switch -- at least take a break from perl for awhile to see how the other
side lives.

Thanks
Joel






More information about the Python-list mailing list