Re: 20 Stages of Perl to Python Conversion
by Mike Rovner other posts by this author
Aug 16 2002 6:38PM messages near this date
Re: 20 Stages of Perl to Python Conversion
|
Re: 20 Stages of Perl to Python Conversion
"Andrew Dalke" <dalke@[...].com> wrote in message
news:3D5C9663.9090205@[...]..
> Or, more generically, write the Perl flavored Python code and
> complain that it's complicated, verbose, and slow compared to
> the original Perl code. Then after talking with someone with
> a bit more Python experience, you realize there is a more
> Pythonic way which fixes all those problems.
Well, it's really more slow.
I had a small (in number of lines) project which shall compare tens-megabyte
text files.
First it seems a perl task. So I implemented it on perl, run several times
and forget.
Later on the guy who needed it came again and asked for couple new features.
So I reimplemented it on python.
First good thing was I immediately recovered 3 bugs in first implementation
because perl
try to use defaults everywhere, so they went indiscovered.
Second of cause was ease to add that new features, but trade of was speed.
Even using compiled re doesn't save me. Speed was about 2 times slower then
perl without //o
modifier.
But anyway the guy was impressed by two-day implementation instead of whole
month C++ programming. :))
Mike
--
http://mail.python.org/mailman/listinfo/python-list
Thread:
Carl Banks
Alan James Salmoni
Mike Rovner
=?iso-8859-1?q?Fran=E7ois?= Pinard
Max M
Ken Seehof
Andrew Dalke
|