Python questions from C/Perl/Java programmer

Tim Peters tim_one at email.msn.com
Tue Aug 29 00:11:51 EDT 2000


[posted & mailed]

[Tom Biggs]
> ...
> I'm a fanatic Perl programmer but not to the exclusion of all else.
> ...
> Several Perl/C/Java programmers I know raved so about Python
> that I just had to investigate.  I like what I've seen so far _very
> much_.

Then you're not *really* a fanatic Perl programmer at heart -- so there's
some hope for you yet <wink>.

> I doubt I'll abandon Perl altogether - I try to pick the right
> tool for the right job - but Python looks very clean.

I was a Perl programmer before I picked up Python, but that was in '91(!).
You're clearly not insane either <wink>, so you may well follow the same
path I did (& many others have reported since):  you continue using Perl for
most things.  When Perl is driving you nuts, you do a little more in Python.
As a side effect, you slowly build a library of Python modules that does
much of what you do every day, and it's so darned easy to write Python
modules and classes, and so darned easy to read them six months later, you
slowly start reaching for Python more and more.  Over time, the size of a
program you're *willing* to tackle in Perl first shrinks.  Then comes the
day you're staring at one page of Perl, need to add 3 more features,  the
first 3 attempts die in hard-to-track-down ways, and you think "oh, screw
it!  I'll rewrite the whole thing in Python instead".  This is a happy day
<wink>.

After a year or two, you may well find your Perl use reduced to 5-liners!
And even then, over & over you find yourself saying "hmm!  If I had written
that in Python instead, I wouldn't have had to track down this bug".

After 10 years, you may end up like me:  I still enjoy *reading* funky Perl,
but I personally never write it anymore except for cmdline one-liners.

> And Perl's OO stuff is just ridiculous, a hasty slap-on-the-side kludge.

Heh.  If you ask Larry, he'll you that Perl's OO implementation was largely
inspired by Python's!  There are a *lot* of similarities under the covers.
But I agree all the same:  "doing OO" in Perl5 is agonizing.  People who
despise syntactic sugar are missing a great counter-example here (and,
honest, Python's object.attr and Perl's $object->{attr} do (almost) exactly
the same thing!  Python doesn't shove the implementation's dicts (hashes to
you <wink>) in your face all the time, though -- but they're there if you
ever do want to play with them directly).

> So you'll probably be hearing some newbie questions from me.
> *After* I read the FAQ of course...

Cool!  c.l.py is a pretty friendly place, ask away.

just-don't-say-anything-to-piss-us-off<wink>-ly y'rs  - tim






More information about the Python-list mailing list