[Israel.pm] Python talk

Omer Zak omerz at actcom.co.il
Mon Dec 6 19:46:27 PST 2004


On Tue, 2004-12-07 at 02:10, Yuval Yaari wrote:
> Omer Zak wrote:
> 
> >I am one of those who programmed in Perl and later switched to Python.
> >
> For how long did you use Perl?

Few years.

> How frequently?

Daily, when working as freelancer for a certain company.

> Did you pass the basic level? (I'm asking this seriously)

This is a good question.
I used Perl 4, as this was what the client's system used, and it was not
justified to convert to Perl 5 with all qualification and certification
tests needed to ensure that the existing scripts continue to work the
same way.

> >My best guess is that it is because Python has a more intuitive way to
> >represent nested data structures.  If one wants to represent an array
> >(list in Pythonesque) of associative array (dict in Pythonesque) elements
> >whose keys are themselves immutable arrays (tuple in Pythonesque) - it is
> >very intuitive to represent it in Python.  In Perl one would have to deal
> >with references and other yukky stuff which I didn't get around to master.
> >
> This answers one of my first questions.
> Nested data-structures is rather basic.
> I think most people get to use it on a daily basis.
> 
> Python is generally not intuitive. I once thought about learning it (and 
> dropped that idea after actually looking at the language, sorry) and its 
> syntax is very weird.

Interestingly, this is the complaint non-Perlers have about Perl.  This
supports the hypothesis that one's brain needs to be wired in a
particular way to work optimally with Perl.

> You must know Python in order to read it, whereas I often see C/C++ 
> people "understanding" Perl very easily.

Probably it is matter of how one's brain is wired.  Personally I find
Python easier to follow than Perl.

> I still can't see what's "yukky" about references, isn't it the same in 
> Python? Care to give us a small snippet?

I'll write, in Python, an associative array, whose keys are arrays and
its data are themselves associative arrays.  Show me how to write it in
Perl.

COMPLICATED_ASSOC_ARRAY = {
  (0,0) : { "label" : "Origin of the World", "population" : 0 },
  (0,90): { "label" : "North Pole", "population" : "varies, usually 0"},
  (0,-90):{ "label" : "South Pole", "population" : ("penguins",10E6)}
}

                                    --- Omer
-- 
My own blog is at http://www.livejournal.com/users/tddpirate/

My opinions, as expressed in this E-mail message, are mine alone.
They do not represent the official policy of any organization with which
I may be affiliated in any way.
WARNING TO SPAMMERS:  at http://www.zak.co.il/spamwarning.html




More information about the Perl mailing list