oreilly.comSafari Books Online.Conferences.


Komodo 3.5 for Dynamic Languages

by Michael J. Ross

Newly minted software developers are typically delighted to discover the power of modern programmer's editors, with syntax highlighting and coloring, auto-indenting, incremental search, etc. Their delight quickly disappears when drowning in a sea of print statements needed to watch the changing values of variables. That's the fundamental reason why integrated development environments (IDEs) are a must-have tool for programmers. They make coding, debugging, project management, and other aspects of software development so much easier and faster. This, in turn, allows the developer to focus his energy and attention on less mundane activities, with more creative energy.

There are many IDEs on the market for dynamic programming languages such as PHP, Perl, and Ruby. I personally have tried several of them, ranging from such heavyweights as Eclipse to little-known IDEs that lack features but not idiosyncrasies.

This article reviews one of the most respected IDEs available, ActiveState's Komodo. As of this writing, the current version of Komodo is 3.5.3. Komodo is available for Linux (Debian/Ubuntu 5.04+, Red Hat/Fedora 3+, and SuSE 9.0+), Mac OS X (10.4 and 10.3), Solaris (8+), and Windows (XP, 2000, NT 4.0, ME, and 98).

Within each platform category, there are two different editions of Komodo: Personal and Professional. The former is for personal and educational use, while the latter is for corporate and commercial use, and has additional features to support professional and team development, including source code control, GUI building, and package management. Furthermore, the Professional edition's licensing fees of $295 are an order of magnitude higher than those of the Personal edition, at $29.95. ActiveState licenses allow you to use a licensed product on all supported platforms.

Komodo recognizes over 30 languages and boasts especially powerful support for Perl, PHP (including 5.1), Python, Ruby, Tcl, and XSLT. In fact, it has fully integrated Ruby support, including debugging, code intelligence (including Code Browser support, Object Browser support, AutoComplete, and CallTips), an interactive shell, syntax checking, syntax highlighting, and code folding. In this latest version, the graphical debugger now supports Ruby on Rails.


Komodo's built-in editor offers features that experienced coders have come to expect of modern programmer's editors: multidocument editing with tabs, syntax highlighting, stream and block selection, multiple undo and redo, smart-indenting and outdenting, incremental and cross-document search, code-folding (collapsing and expanding blocks), split view, keystroke repetition, recordable macros, code block commenting, and text joining and reflowing. Komodo's syntax capabilities are excellent; they include syntax highlighting with color and syntax checking. This instant visual feedback invariably saves time and reduces bugs. Komodo offers syntax highlighting for over 30 languages. Also, the syntax colors are fully customizable (via Edit > Preferences, not the more standard Tools > Options).

Like the better non-IDE programmer's editors, Komodo has extra features, such as code completion ("AutoComplete"), display of language and user-defined function parameter lists ("CallTips"), Emacs-like key binding, and optional removal of whitespace on line endings.

Programmers spend a lot of time searching and replacing text within code. Thus, an IDE's search-and-replace capabilities are of paramount importance. In this regard, Komodo is more than adequate, though not stellar. It allows regular expressions in text searching, including the use of found text dynamically within the replacement string. It is not documented, but uses the standard Python and Perl syntax of grouping using parentheses and replacement strings identified as $1, $2, etc.

Komodo allows searching within directory trees. The menu item is Edit > Find in Files, which I did not even notice at first, being accustomed to having it as part of a single search-and-replace dialog. One nice feature, which I have not seen elsewhere, is the ability to exclude files from searching. This includes wildcard support.

For programmers who find themselves pasting the same type of code frequently, Komodo's code snippets capability should prove quite handy. It allows you to store any piece of code for later reuse. On the other hand, you should use large snippets judiciously, as any copying and pasting should first alert the wise programmer to perhaps modularize that code in a separate function--true reuse.

Developers creating code for applications and websites intended for an international audience will appreciate Komodo's multilingual Input Method Editor (IME) support, which allows standard keyboard codes to enter complex multibyte characters and symbols for French, German, and Spanish, as well as Asian languages.

Graphical Debugger

If the features discussed above were all that Komodo offered, then a top-of-the-line programmer's editor such as jEdit would suffice. Perhaps the first capability that attracts a new developer to any IDE is the debugger, which beats endless print statements. For Perl code, this exceeds the text-based native Perl debugger.

Komodo's graphical debugger has all the standard debugging capabilities: breakpoints; stepping in, over, or out of a function; watched variables; display of the call stack; and display of terminal output. You can modify variables midstream in a debugging session. You can disable a breakpoint without deleting it, which saves time when later trying to remember the optimal locations of unneeded breakpoints. One terrific feature is that Komodo presents complex watched variables in an intuitive tree format. It also allows you to expand arrays and hashes, nesting individual parts of those structures.

The IDE also has some features that are more appropriate for advanced programming scenarios and special cases, such as remote debugging and multisession debugging, or simultaneously debugging multiple applications in multiple languages--scenarios that are beyond the scope of this review.

As the original versions aimed at PHP and Perl programmers, Komodo has full CGI emulation, which allows you to control the environment seen by the CGI script running locally in a web server on your machine. Unfortunately, by default, every Debug run causes the "Debugging Options" dialog box to appear, even if you do not want to change any of the debugging options for that run. Fortunately, you can bypass this in Linux and Windows by holding down the Ctrl key. Bypass it automatically by changing your preferences.

To get PHP CGI emulation to work, you must disable force-cgi-redirect by setting cgi.force_redirect to 0 in Komodo's php.ini. Otherwise, Komodo can report the error "Security Alert! The PHP CGI cannot be accessed directly. This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g., via an Apache Action directive." After updating php.ini, test it by running a PHP script with "Simulate CGI Environment" (in the "Debugging Options" dialog box) checked.

Somewhat related, when I tried to run the PHP tutorial script (php_tutorial.kpf), I received the error "Please correct your interpreter selection in preferences," even though I had it set correctly to the appropriate PHP executable. (Think of it as a holdover from Windows' Ctrl+Alt+Del...) Apparently Komodo version 3.5.3 will remove the need to restart the application.

Pages: 1, 2

Next Pagearrow

Sponsored by: