Python suitability
Darrell
darrell at dorb.com
Wed Dec 15 09:58:05 EST 1999
Python is easy to learn and very nice for at least the largish project I
just finished. We had a max of four Python developers at one point and the
first release took about eight months. This doesn't sound large from a C++
prospective, I know. But the same project in C++ would have been a much
larger undertaking. Not just in the amount of code but the number of
developers and associated problems.
The quality of our code for the second release was vastly better than the
first. Learning to write good Python took a while.
Some things I noticed that effect most everything.
1. Deciding on a directory structure and whether or not to use packages
was a big debate. Importing the wrong module of the same name is
a problem. Someone installs the latest cool Python thingie and your
application stops working.
2. Memory management is easy, but test for memory leaks.
Or just massive memory usage. It's easy to eat huge amounts of
memory or for some module to tuck away references that can't be freed.
3. Slicing and dicing huge strings is a performance problem. When we first
started everyone was slicing and pasting with a+b+c. Don't do that.
We came up with a Python solution though it required a lot of code
rework. It wasn't until integration that we noticed the problem !
4. Exceptions, error messages and debug control were vastly improved
in the second release. My first attempt was just way too complicated.
Python lends it's self to simple solutions, that aren't always obvious
to a the reformed C++ developer.
5. We have only one C++ extension module even though I wanted to
write more. Seems that what we have is fast enough, at least for
what they want to pay.
6. Many of the things you do in C++ are to over come it's own
limitations. Such as the Visitor pattern that gets written up in the
C++ report every other issue. For the most part it solves a problem
of C++.
How to stop thinking in C++ and start doing things the Pythonic
way takes a while. Find an experienced Pythonist who can review code
and designs.
Go for it, but remember there are no silver bullets, software is hard.
--Darrell
More information about the Python-list
mailing list