[Tutor] Newbie Question - Python vs Perl

Andrew P grouch at gmail.com
Mon Oct 31 17:11:02 CET 2005


If you are interested in learning another tool, please, start with
Python.  If you are interested in scripting UNIX, Perl is a fine
choice.  There prevalence matters, and quite a bit.  But sys admins
are usually very Perl-centric, and in my experience monolingual, and a
bit of an insular community :)

Python is more than the equal of Perl by any measure.  Including
system administration.  But moving beyond that is also a lovely
language for building applications, and everything from lightweight
CGI scripts to using hefty web frameworks, of which there are plenty
to choose from.

Perl is a language of exceptions to the rules.  Python tries very hard
to be consistent, which makes it much easier to learn, and much easier
to use, and much, much easier to apply the concepts you have learned
to other languages.  Including Perl, as a second or third language.

Perl can be coerced into big jobs, but it's not very pleasant.   The
best you can hope to keep in your head at once is your own set of
idioms, which will -not- match anybody elses, and will likely change
from week to week on you anyway.   And really when people tell you
they can't read what they wrote the day before when they come back to
it, they aren't lying!

Having said that, I love Perl, because it -is- quirky and sprawling
and lovable.  It's pretty much the worst case scenario of
everything-and-the-kitchen-sink, and really not so bad for all that,
and definitely more fun for it.  So if that appeals, then you'll have
fun too.

But Python tends to be compared to general purpose languages like Java
and C++ more often.  OOP heavyweights of the world.  Actually, let me
find that quote by Bruce Eckel, who wrote the (very) popular "Thinking
in Java" and "Thinking in C++" books.  Here it is:

"I believe it was definitely worth moving from C to C++, and from C++
to Java. So there was progress there. For something as advanced as
Python is over those languages -- and as different -- there will be
some hesitation."

And:

"When you have the experience of really being able to be as productive
as possible, then you start to get pissed off at other languages. You
think, 'Gee, I've been wasting my time with these other languages.'"

That second quote applies to many "language vs language" comparisons,
obviously.  But it's food for thought.

Oh, and never underestimate the power of the interactive interpreter! 
Don't do it!  Ever!

Take care,

Andrew

On 10/30/05, Scott Clausen <scottclausen at mac.com> wrote:
> As a newbie to Python I'd like to know if someone can tell me some
> strengths and weaknesses of this language. The reason I'm asking is a
> friend told me I should learn Perl over Python as it's more
> prevalent.  I'm going to be using it on a Mac.
>
> I'd appreciate hearing any views on this topic. My own view is that
> it's always good to learn new things as you then have more tools to
> use in your daily programming.
>
> Thanks in advance.
>
> Scott
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>


More information about the Tutor mailing list