On 2/14/07, Michael L Torrie <[EMAIL PROTECTED]> wrote:
On Wed, 2007-02-14 at 15:48 -0700, Andrew McNabb wrote:
Thought I'd interject with a few of my favorite things to hate about
python.

Most of my issues with python surround the "duck" typing system.  This
works very well for lots of things.  Basically the type of an object
doesn't matter so long as it supports the protocol you want.  Thus you
can use the "for x in " operation on any object that is iter-able.  The
problem is that there's no easy way to discern ahead of time what is
expected when you pass an object to a function.  You can use
introspection to get the built-in docs, ask the function how many
parameters it's expecting, true.  But if the docs don't say, you have no
idea what methods the function is expecting to call on the object until
you try it and get an exception.  This often makes working with
third-party libraries very painful.  I had to run several python twisted
networking apps in a debugger until I figured out just what the
different methods and functions in twisted are expecting, the good docs
notwithstanding.  The source code is essential in finding out some of
these things.  So while I find dynamic typing extremely powerful, it
does have warts.

Isn't this limitation true of all dynamic languages?  This isn't a
python specific problem, but the side-effect of not requiring the
declaration of parameters, their "type", and the order in which they
are expected?  Wouldn't you have the same issue you're describing with
Perl or Ruby?

The other major architectural limitation in python is the GIL, a giant
lock that synchronizes calls to the interpreters core.  Thus
multithreaded programs can not utilize multiple processing units.  In
practice this usually isn't a huge deal.  I'd say much of the time a
multithreaded app is best done with an asynchronous library anyway, like
twisted.  But threads have their place.  Just be aware of this
limitation when doing heavy computations with python.

If I were doing heavy computations, I'd likely use Java.  I know
that's a cop out.  I'm not saying your concern is invalid.  But, for
*me*, if I had to do threading or heavy processing I wouldn't use a
scripting language at all.

Thanks, for the heads up though, Michael.

-Bryan

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to