Lately, I've been working on a new development project using Python.
This has been an interesting project for me because I'm in the unusual (for me, at least) position of being the "technical guru" and am able to make most of the technical decisions on the project without really being questioned or challenged. It's different than my usual situation where I'm working for corporations and all the big development choices (programming languages, web frameworks, databases, version control system, etc.) are already established. Like most consultants/contractors, I'm usually hired largely on the basis of a match of my skill set to those tools rather than my overall abilities (sad, but true).
Anyway, I decided on Python as the primary development language. Scripting languages seemed a good fit for the kind of work we're doing, so I considered several from the mainstream: Python, Perl, Ruby, and VB. (We're not doing web development or I might have considered PHP.) It's easy to quickly bang out useful applications using scripting languages like these without all the development overhead of languages like Java and C#. Personally, I enjoy Python because the syntax feels comfortable to me (not far from Java), unlike some of my other choices. Because this particular organization has a lot of developers coming and going, and many of them are relatively unexperienced, Python is a good choice because its easy to learn, and the code is clean and readable. Developers new to Python can ramp up quickly using the many great learning materials available on the web (for free!) and in print.
Because some of the early problems we needed to solve required access to COM bindings, Visual Basic might have been an appropriate choice. However, since Python has win32 support built into the ActiveState distribution, it was easy to work with COM. VB didn't suit me for a few reasons. First, I have little experience with it, so I would have a learning curve to overcome. The organization doesn't have deep pockets, so development tool licensing costs are an issue. Finally, VB doesn't run on my Macs. Of course, neither does COM, but at least with Python we have a path to cross-platform goodness.
A huge advantage of Python is its excellent Unicode support throughout the language and libraries, especially in the latest versions. It turns out that the application involves manipulation of XML documents written in different (human) languages that use different (non-Western) character sets. I hadn't anticipated the implications of this due to my unfamiliarity with the problem domain, but now I'm really glad that it worked out. The Unicode-enabled regular expressions have been useful, as well as the (mandatory) Unicode support in the XML libraries. It turns out that several of the other scripting languages have yet to fully and natively support Unicode.
In the back of my mind I had wanted to jump on the Ruby bandwagon, but the maturity of the language concerned me. Even though it's been around for many years, it has only seen widespread adoption very recently. I also chose Python because of its maturity; it has been around for long enough and used by enough people to have worked through the major issues, and more importantly, to have good tool support and third-party libraries. It takes some years for third-party tool support to come around.
Using Python has a been a win so far. It took me about a week and a half to rewrite and enhance the existing code-base, which I think took about a man-month to originally code using VBA/MS Word. A lot of my time was wasted screwing around with Word's broken (really bad) COM API, so my actual time with the Python code was pretty short. Of course, it's always quicker to rewrite existing code than to create it from scratch, so that balances out the wasted time. The new code is nice and modular, so I'm on a good path to factoring out the functionality originally needed from Word into a wxPython GUI.
Recent Comments