OO conventions

Blair P. Houghton blair.houghton at gmail.com
Sun Feb 5 03:48:43 EST 2006


Alex Martelli wrote:
> As you see, static methods have a small extra lookup cost (a couple
> hundred nanoseconds on my oldish laptop);

I would've expected the opposite effect...I guess the runtime
considers instances more active than the static portion of
a class.

> "Premature
> optimization is the root of all evil in programming", as Knuth wrote
> quoting Hoare -- and anybody who's read Knuth's work knows he is
> anything BUT indifferent to real optimization; the key is avoiding that
> "premature" part!-)

Apropos of which someone mentioned in a thread on Slashdot
today about writing an entire program's code in Python first and
then optimizing portions to C or C++ only as performance warrants.

Seems like a good idea.  I've noticed Python is a lot easier to
get up-and-running with, even if you're as unfamiliar with it as
I am, compared to the other two.

--Blair




More information about the Python-list mailing list