[Tutor] Python Advocacy

Deirdre Saoirse deirdre@deirdre.net
Fri, 13 Apr 2001 23:02:58 -0700 (PDT)


On Fri, 13 Apr 2001, Sheila King wrote:

> I have a couple questions about Python: 1) It's speed in relation to
> perl...  If figure this will be subjective to the task at hand - but
> hopefully there is an average overall performance increase/decrease...
> I would assume lugging around the OOP methodologies will impose
> overhead which would be pretty much unavoidable...

OOP is not inherently slower. Late binding is slower than early, no
question. However, python is byte compiled, which may offer speed
advantages. However, in general, if you're looking for speed, you wouldn't
be using perl either.

> 2) How does it stack up against Perl's regex capabilities, which I rely
> __heavily__ on for massive processing duties...

The python regex is modeled after perl.

http://www.python.org/doc/current/lib/module-re.html

> 3) How well does it perform auto-vivication of complex data structures: e.g.:
> http://www.perl.com/pub/doc/manual/html/pod/perldsc.html
> **yes, I know that perl's dereferencing syntax is for masochists, but once
> mastered - the sadistic side shines through...

It's also like flying in bad weather without instruments. :)

Python has lists and lists of lists and classes (which can contain their
own members). But it doesn't have hashes, nor does it need them.

> I have some projects that might fit better into an object oriented way of
> thinking - however I must be careful of time spent learning 'Yet Another
> Programming Language' since deadlines could quickly slip...

Well, here's the thing: perl is essentially awk on steroids. Python is a
general-purpose programming language. Do you intend on sysadminning
forever? Because shell scripting will limit your career options more than
learning a more traditional-style language.

--
_Deirdre   NEW Stash-o-Matic: http://fuzzyorange.com  http://deirdre.net
"I love deadlines. I like the whooshing sound they make as they fly by."
                                                         - Douglas Adams