|
|
AS OF 7/4/2008 8:28PM EST
|
Ruby Reaches Big Leagues With Two IDEs
Komodo, Ruby in Steel updates drive spread of object-oriented scripting language
By Larry O'Brien
March 15, 2007 —
The year has started off well for Ruby programmers developing on Windows. After a year of explosive growth in popularity, the object-oriented interpreted language with particular strengths in scripting and Web development finally has not one, but two professional development environments that give the language the primacy it deserves.
Not that the environments of either Komodo 4 (ActiveState, US$295) or Ruby in Steel (SapphireSteel Software, US$199) are Ruby-specific; Komodo is well known in Perl and PHP development circles, and Ruby in Steel is a plug-in for Visual Studio 2005 (Standard Edition and aboveusers of the free Express Editions are unfortunately excluded).
RUBYS RISE Ruby was first released to the public in 1995 by its designer Yukihiro Matsumoto and developed to a broadly usable language by the early 2000s. For a few years, it was a well-regarded but not particularly popular alternative to the so-called dynamic languages in the Perl/Python continuum. Compared with other dynamic scripting languages, Ruby is distinguished by completely embracing object orientation as an organizing principle. The influence of Perl and Smalltalk are clear in the design of the language, with Perls scripting-oriented love of implicit variables and optional parentheses and Smalltalks emphasis on manipulating objects with a straightforward grammar. Rubys grammar is complicated somewhat by the aforementioned optional elements, as well as inconsistencies on the equivalence of curly brackets and do
end tokens.
The 2004 release of David Heinemeier Hanssons Ruby on Rails opinionated Web framework sparked the current Ruby fever. Rails philosophy of convention over configurationin which likely good enough decisions about project structure, naming, build strategies and database mapping are automatically generatedwas both provocative and productive.
Popular books from The Pragmatic Programmers further evangelized the language, tied it to the latest trends in agile development, and with their sales triggered the current avalanche of books, blogs, conferences and coverage. And, now, development environments.
Ruby is unusual in that the two areas in which it has the greatest demonstrable strengthsmall scripts and Rails-based Web developmenthave remarkably different development styles. Scripts, ranging from a few to a few hundred lines of code, are the stuff of a single file, hard-coded paths and variables, interaction and quick edits.
The conventions of Rails include a project tree with an even dozen high-level folders, organizing such things as database scripts, plug-ins and unit tests. Theres still rapid iteration (if youre not interested in rapid iteration, Ruby isnt the language for you), but development is more likely to involve longer sessions, more open files and lots of navigation. Both Komodo and Ruby in Steel can be used successfully for both styles, but an emphasis on one over the other does turn out to be important to a decision between the environments.
Ruby in Steel is hosted within Visual Studio 2005. It has to be emphasized immediately that despite its association with Microsofts development environment, Ruby in Steel does not provide a Ruby for the Common Language Runtime (aka the .NET Framework), but instead targets and debugs within the standard Ruby interpreter. The download and installation, while painless, had a few glitches: It silently assumed the wrong location for my Ruby interpreter, causing my very first Hello World to fail. And while SapphireSteel provides a fast Web server and superior Cylon debugger for Rails applications, they are not activated by default.
The familiarity of the Visual Studio environment is undoubtedly Ruby in Steels greatest strength. The Project wizard adds a new panel for Ruby projects, files are organized in the familiar Project Manager, key-bindings and font choices are as expected, etc. The downside of being a plug-in is, obviously, cost and unfamiliarity if you are not currently a Visual Studio customer.
Komodo 4 had a painless download and installation process, with the notable ability to install on Linux and Macintosh in addition to Windows. I was pleased with the dead-simple integration with source-code control (CVS, Perforce and Subversion) and had no trouble getting a Ruby program up and running in moments.
CODE COMPLETION The great delight in both environments is their support for code-completion of Ruby programs. Ruby uses the familiar object-oriented instance-period-method idiom, and in both environments, a moment after typing the period, up pops a list of potential operations. Ruby in Steels code completion is more comprehensive, working properly on numbers and accurately resolving implicit self references. Both environments do an admirable job of making recently defined functions available, but Ruby in Steel additionally picks up and displays RDoc comments in a tooltip. Further, Ruby in Steel supports type hints provided in specially formatted comments. I am a fan of explicit typing for team-based programming, so I quite like this feature, although it screams for some kind of automated enforcement tool as part of the build/check-in process. Code navigation is speedy in both environments, although again it seems that Ruby in Steel does a better job of dealing with Rubys object model and bringing up appropriate ancestor classes.
DEBUGGING Another great joy of these environments is their debugging support. Both have similar styles: The code editor has a gutter in which conditional and unconditional breakpoints can be set with a mouse click and, once in a debug session, variables can be watched, dynamically inspected and drilled down into.
A slight caveat here for Ruby in Steel users is that a crucial windowthe Ruby Consoleis not made visible by default, one of the few clear flubs in the product. Also, Komodo has the advantage in true interactive Ruby, providing a GUI-based console, while Ruby in Steel relies on running IRB in a DOS box, from which cut and paste is significantly more difficult.
Finally, given Ruby in Steels competence in the editing windows, its odd to report that, inside the debugger, Ruby in Steel seems to be less capable with object structure than Komodo; the Locals window often shows all the in-scope variables concatenated into a single string (they can be disambiguated in the Watch window or the Ruby Console).
The most significant functional gap between the environments is in their support for Ruby on Rails. Ruby in Steel provides spare but functional dialogs for creating, configuring, debugging and using generators in Rails, while Komodo leaves these to the command line; I found the dialogs to be both convenient and helpful.
Surprisingly, Ruby in Steel has better support for developing larger Ruby projects than the more mature, well-regarded Komodo. Ruby in Steels superior implementation of code completion, navigation and dialogs for Rails, Gems and Rake combine with Visual Studios project-oriented model to create a compelling system for larger-scale Ruby development, especially Rails-based. Komodo loads slightly faster, and its superior console and debugger give it an advantage for scripting.
However, both products are fast and much, much more productive than command-line development. The real decision between the two almost certainly boils down to your cross-platform development needs and whether your history is with Visual Studio or with vi and Emacs. Those with a Linux/Unix background will do well with the latest release of ActiveStates Komodo. Those with a Visual Studio background will be pleased with the strong rookie that is SapphireSteels Ruby in Steel.
Larry OBrien, who writes the Windows & .NET Watch column for SD Times, is a technology consultant, analyst and writer. Read his blog at www.knowing.net.


|