Python vs. Perl, which is better to learn?

Patrick W quitelikely at yahoo.com.au
Wed May 1 11:51:47 EDT 2002


claird at starbase.neosoft.com (Cameron Laird) writes:
>
> [...] You are right that it's con-
> siderably more expensive to learn two
> languages, or a mix of two languages, than
> a single one.  One has to expect that there's
> a far greater return-on-investment for
> learning the first, than the second.  This
> puts a premium, of course, on making a cor-
> rect choice for the first.

Indeed. I'm sure you understand me, but let me elaborate:

import IMHO and sprinkle it liberally throughout.

A programmer ought to know at least four languages in depth. If those
four languages are well chosen, they can last a lifetime. If they lack
certain features that come pre-packaged elsewhere, it's far better to
acquire the _concepts_ and _techniques_ implicit in them, and
implement them in your chosen language(s), as opposed to madly
accumulating new notations simply because they possess a convenient
feature or two.

I think this popular notion of "right tools for the right job" is
actually very harmful, both to individuals and to the science/industry
as a whole. To stick with the tradesman metaphor for a moment, I think
it creates a culture in which programmers are encouraged to become
"jack of all trades, master of none." Resumes may be stuffed full of
impressive sounding acronyms, but programmers actually don't know as
much as they once did. It's not because we're stupid (although the
barrier to entry is considerably lower these days); it's partly a
result of having too many alternative implementation details to
learn. When depth is sacrified for breadth, beyond a certain point, it
becomes a very bad thing.

To make sensible choices up front, and to focus on a few languages and
topics to the exclusion of many others is the only way to go. That's
why I reject this "learn them both" approach, unless the languages are
different enough in purpose and style and philosophy to make them both
worthwhile and complementary.

So, choice is necessary, but what to choose?

IMHO, the best choices for starters are:

* One of [C, C++] for maximum efficiency, minimal overhead and an
  understanding of the low-level foundations of higher level
  facilities.

* One of [Python, Perl, Python, Ruby, Python, Tcl, Python] for general
  purpose programming and scripting. For my money, Python is the clear
  winner in this category. It's great for everything from text
  processing and os scripting through to graphics, multimedia, comms,
  database programming, web development, etc. It's just as much fun
  for skilled hackers as it is for beginners.

* Something that encourages a different style of thinking. My own
  favourite (for this purpose) is Lisp. I feel that Lisp is powerful
  enough to handle anything I'll ever throw at it, and it's flexible
  enough to incorporate any new programming paradigms that computer
  scientists are brilliant (or crazy, or foolish) enough to think up.

* Whatever else turns you on.

> So far, we're conversing rather abstractly.
> In the specific case of Perl vs. Python, I
> contend that:
> 1.  their functional roles are quite
>     similar;
> 2.  both languages are "lightweight"
>     in the sense that one can start
>     to use them with only a few hours
>     spare time; and

Yes. 

> 3.  their "subjective" applicability
>     is rather polarized.
>
> [ trimmed ]
> 
> My conclusion:  *experience* both languages
> (a modest investment), decide for yourself the
> "first impression" each makes, pick the one 
> that feels right, then *learn* that language,
> with confidence that you're missing little by
> choosing only that one.

Absolutely. Then extend it with concepts and techniques from many
other sources. There's far more value in that than in learning a new
notation every few months (provided the initial choices are good
ones).



More information about the Python-list mailing list