Perl Vs Python

Mats Kindahl mats.kindahl at nowhere.net
Wed Feb 26 06:58:25 EST 2003


"Bo M. Maryniuck" <b.maryniuk at forbis.lt> writes:
> On Wednesday 26 February 2003 02:05, John Smith wrote:
>> Hello: do Perl & Python do similar things?  What should be the
>> rationalle to one or the other?
> 
> - Try to read your own Perl code one year later and you'll be
>   surprised how *ugly* Perl is.

I do that regurlarly and have no problems adding new features to code
that are years old. I guess it's a matter of discipline when coding.

> - Perl is not ObjectOriented. It *looks like* OO.

Perl has constructs to define abstractions, provide encapsulation, and
implement inheritance. I don't know what your definition of
object-oriented is.

> - You can not provide the bytecode for end-customer if you would not
>   like to show him the sources.

True. That's a problem.

> - Do you like this schizophrenic syntax?:
> map{($_[0])?s/\s\s+/,/gs:$_;($?)?push(@M,$_):$_;(/wap:/)?$?=$$:$_;}split($/,`cat /proc/meminfo`);

Where on earth did you find that?! It looks more like something taken
from an "Obfuscated Perl Code Contest".

> <IMHO>
> - Perl is fast (interpreter), but not designed for big applications.
>   It is good for scripts up to 100 codelines.
> </IMHO>

There are some really big applications written in Perl. Again, I
guess it's a matter of discipline.

It is true that Perl is usually faster than Python (but it's no more
interpreted than Pyton). That should, however, not be used as the
basis for deciding which language to use.  It is more important to
pick a language that you feel "comfortable" with.

Having said that, I would recommend anyone with little previous
programming experience to favor Python before Perl. The syntax of
Python *is* easier to the eye and the indentation syntax is, IMHO,
more forgiving for aspiring programmers.  Also, using Perl for large
projects require experience and coding discipline, something that it
takes years to learn.

Regards,
Mats Kindahl
-- 
IAR Systems in Uppsala, Sweden.

Any opinions expressed are my own and not those of my company.

Spam prevention: Contact me at mNaOtSkPiAnM at acm.org, removing the *NO
SPAM* from the address.  Do *not* use my work e-mail address: I'm not
there right now.




More information about the Python-list mailing list