Potpourri for geeks

Opinion
Jul 21, 20034 mins

This week we have a few odds and ends to clear up. First, regarding the Python programming language that we did a series of columns on, reader John Gay wrote: “It might be elegant, but it looks like a troubleshooting nightmare. Structuring code for readability makes sense, but embedding intelligence in indents takes us back to the 80-column punch card days, when spaces mattered a lot.”

We must disagree on the issue of the difficulty of debugging Python – in our experience and from comments and discussions in a number of books we have on the language, Python is relatively straightforward to debug. In many ways Python is much easier when tracking down those really thorny problems because you can modify the code so easily and it supports mechanisms that let you “get inside” the Python system.

According to Alex Martelli and David Ascher, the authors of the excellent Python Cookbook: “The introspective and dynamic nature of Python . . . means that your opportunities for debugging are limited only by your imagination. You can replace functions at runtime, add methods to classes and extract everything about your program that there is to know. All at runtime, and all quite simple and Pythonic.” They attribute this to be the result of Python’s creator’s “we are all consenting adults” philosophy of programming.

Python Cookbook, a fairly in-depth book for competent Python aficionados, has a whole and indispensable chapter (Chapter 14) on the topic of debugging and testing. What you learn from this and other books that discuss Python application troubleshooting is that Python exposes its internal mechanisms in a way that most other languages cannot.

As for Python’s requirement for structuring by using indents, it does take a little getting used to but the upside is that once you’re used to it, your code is remarkably readable. And it is not at all like working with 80-column punch cards, a gruesome way to program that still has us waking up in the middle of the night sweating (remember that endless punch, run, fail, re-punch, drop on the floor, sort out, run, fail, re-punch again routine?).

While we’re on the topic of books about Python, we should mention a few others that are terrific and arguably indispensable. First, there’s Learning Python by Mark Lutz and David Ascher, which is one of the best books for learning the language. It starts with the language basics, passes through object programming and winds up with some useful and instructive examples that demonstrate complicated application techniques. It also contains a good introduction to a cool version of Python implemented in Java called Jython (which they refer to as “JPython” for some reason).

Two other Python tomes we should recommend are Python in a Nutshell by Martelli, a terser introduction than the Python Cookbook; Python Pocket Reference 2nd Edition by Lutz, which no self-respecting Python programmer can be without; and the megawork, Programming Python, 2nd Edition, by Lutz, which, at more than 1,000 pages, is not only an impressive achievement but also will teach you some really hard-core Python programming techniques.

Finally, having mentioned Jython we must point to Jython Essentials by Samuele Pedroni and Noel Rappin, an exploration of the language showing how it integrates efficiently and powerfully with Java as a way of creating scripting and applets.

Still on the topic of Python although it relates to Perl, Tcl, PHP and Extensible Stylesheet Language Transformation (XSLT) as well, we should direct you to take a look at Komodo. Komodo is an awesome integrated development environment from ActiveState that supports multiple languages along with multi-document editing, syntax-checking and coloring, code-folding and autocompletion.

Komodo also features a graphical debugger, remote debugging, Common Gateway Interface emulation, XSLT debugging and, if that wasn’t enough, tutorials. Actually, there’s a lot more than that to Komodo, but we’ll leave it up to you to check it out.

Finally, we must mention the latest release, Version 8.0, of Ipswitch’s WS_FTP Pro. New in this version are support for firewall and network address translation, Secure Sockets Layer, Secure Shell, SOCKS4 and SOCKS5 Proxy Support; Active Edit, letting you locally edit files on remote FTP sites; and HotDrop, which lets you transfer files or folders to predefined sites by dragging and dropping files into HotDrop folders.

Drop your thoughts on gearhead@gibbs.com.