Typing system vs. Java

Charlie Clark charlie at begeistert.org
Fri Aug 10 18:32:17 EDT 2001


Andy Freeman wrote:
>> But why can't Python be fast enough without resorting to extensions?
> Forcing
>> users to learn C in order to make their Python code fast detracts
> from
>> Python's advantage as a simple, easy-to-use language.
What is meant by "fast"? How long does it take to write the improvement?
But this is wrong anyway. Running code doesn't usually need to be
optimised. The problems start and time gets wasted when things have to
be changed. Being able to change something locally because of a changed
condition *can* be very valuable when compared to globally redefining
some types and chasing them in the code,.

> Of course, there's another alternative - with Python's development
> time
> advantages, they'll have more time to come up with better algorithms,
> so
> they may not need the extension.
Or working out that speed improvement has no affect on the application.
This is true for me from personal experience. I am currently working on
some HTML-parsers. The first one I did use string functions and was very
fast (0.5s) but it was very inflexible. The ones I write now use htmllib
and are slower (2.5s) but are much easily adaptable. As the scripts run
once or twice a day, the performance difference is virtually
immeasurable. The biggest optimisation is actually parsing as little as
possible.

>> personally don't think that type declarations would add much
> complexity, but I
>> guess I can see how someone new to them might be confused.
>
> You must have missed a post or two.  If they're required, they either
> aren't
> adequate, or they are complex, or both (C).

I make extensive use of transformation of data. Adding stuff to lists is
just so easy and I don't see why I need a new name just for the final
"event".

>> Of course, that same person would be lost once they had to learn C.
>
> And maybe they'll never have reason to learn C.  I suspect that a fair
> number of SQL programmers don't.  I'm sure that many Excel programmers
> don't.  Yet, both are able to write programs.  Why is it reasonable to
> assume that a Python programmer will need to know C?
>
I have no intention of learning C although I'm neither an SQL programmer
nor an Excel programmer. SQL isn't fast either, it isn't supposed to be
but it offers portability across databases which some people obviously
think is a good thing.

I like Python. I can get it to do the things I need done without too
many sleepless nights I cannot imagine getting half as much done with
any of the other languages that I've seen. I actually wish I didn't have
to program but I can often get prototypes knocked up in Python in the
same time it would take to explain what I need to a real programmer. I
can then give it them to improve when the time comes. Saves us both a
lot of time.

Charlie



More information about the Python-list mailing list