Why should I switch to Python?

Paul Winkler slinkp23 at yahoo.com
Thu May 11 13:27:58 EDT 2000


James Felix Black wrote:
> 
> > Two big ones come to mind: using complex data structures, and
> > modularizing your code. Both are much easier in python.
> 
> I won't dispute your second point, but I don't understand your first.

The only explanation for this that I can think of is that you're a
lot smarter than I am!
 
Python: nesting data structures preserves the structure.

Perl: nesting data structures flattens the structure, unless you use
references.

OK, that's not such a big deal; I could live with that, it's just a
little more punctuation needed to make the structure, and it's not
hard to read. It's getting stuff *out* of the data structures that I
find to be radically different.

(code snipped)
> Sure looks similar, doesn't it?

Not to me. The key line is this, in my version:

	for f in friends[name]: 

Your version:

	for $f (@{ $friends{ $name } }) {

>  Of course, the de-referencing of the
> array reference looks bizarre,
                   ^^^^^^^^^^^^^

Yes, it does. :) More to the point, I got too frustrated with
staring at man perldsc and man perllol trying to understand it. Can
you explain the meaning of each bit of punctuation on that line?
Faced with something I thought should be simple, but took up 1200
lines in the perl man pages, I gave up. I got to like perl because
it was easy; I gave up on it because I needed complex data
structures and they were driving me crazy. I'm really honestly
impressed that you can do it with no trouble, but I think a lot of
people who need scripting languages will have a similar reaction to
mine: "This is too hard!"

 
-- 
................    paul winkler    ..................
slinkP arts:   music, sound, illustration, design, etc.
A member of ARMS    ----->    http://www.reacharms.com
or http://www.mp3.com/arms or http://www.amp3.net/arms
personal page   ---->    http://www.ulster.net/~abigoo



More information about the Python-list mailing list