Developer

Hands on with CodeGear's 3rdRail Ruby IDE

Justin James says that, if you're a Ruby or a Rails developer in need of an IDE, you'll definitely want to check out CodeGear's 3rdRail -- despite its flaws. He says the product even inspired him to start learning Ruby.

 

For a long time, I blamed the lack of good tools for the reason why I hadn't tried out Ruby. That excuse disappeared some time ago, when CodeGear gave me a copy of 3rdRail, its Ruby IDE to try out.

Still, there was something about Ruby that kept scaring me away. Maybe it was that the syntax looked like it relied a lot on symbols, but at the same time, was not a pure C-style language. In any event, I finally overcame my fear of Ruby and jumped right into it with the help of 3rdRail. This article is based on 3rdRail 2.0, which was released in mid-November 2008; however, I initially used 3rdRail 1.1 for a brief time. I'll highlight some of the differences between 3rdRail versions 1.1, 1.2, and 2.0.

Introduction and installation

3rdRail is an IDE for working in Ruby. The Ruby ecosystem has really embraced the Ruby on Rails platform, and 3rdRail can develop applications for that system too. 3rdRail is based on Eclipse, so developers who are familiar with Eclipse will probably feel comfortable in it.

The 3rdRail package is also nice enough to deploy a full run-time environment for you. As someone who has struggled at times to get a run-time environment working on my development PC (Oracle and Tomcat both come to mind), this is much appreciated. Let's face it: Few developers know how to (or want to if they do know how) play the "systems administrator" game.

It took a few tries to get the local MySQL instance installed in a way that let the 3rdRail IDE hook into it. I think that CodeGear would be smart to install MySQL and Ruby on Rails at the same time using scripted installers in a configuration that works with 3rdRail. It was a little disappointing that I needed to work hard to get a complete package working; but this is still a fairly new product, and it is integrated with a large number of open source packages. I was also disappointed that it took a good bit of trial and error to determine that MySQL needed to have a new user added to it, and then I had to figure out what permissions to assign that user; I think that 3rdRail's MySQL installer should have handled that up-front for me.

As a longtime Visual Studio user, I definitely did not feel at home in 3rdRail up front. Maybe it was the differences in how things are done, or possibly the shift in thinking needed to move to Ruby development. I also wondered why a company that is legendary for IDE development over the course of multiple decades suddenly resorted to using a third-party IDE framework for a product.

Once I got into 3rdRail, I liked some aspects of it. The interface is not nearly as busy as Visual Studio's interface, although it lacks much of Visual Studio's feature set. Talking with the 3rdRail product team and from what I've previously learned about Ruby, I get the impression that the Ruby community is very comfortable with not using drag 'n drop in their work and that is reflected in 3rdRail. The ability to run console commands is built right into 3rdRail (it's called the Project Commander), and the tutorials that I walked through made liberal use of this feature. One thing that bothered me was that the application ran in a tab of the main content area of the IDE by default. This means that you cannot have your application running on one monitor and the IDE on a second monitor, which is how many developers prefer to run things. This can be changed, but it is an annoying default that I only noticed could be changed while I was exploring the menu trees. I also found it to disturbing (at best) that the IDE told me its memory usage and gave me the choice of manually running the garbage collector.

The good

One window that I found helpful was the Outline window, which is a tree of the HTML in a view; the node name is the tag, and the data in the node is the tag's content. Each node's sub-elements are the elements within the HTML tag. In the Ruby source code view, the Outline shifted to showing the variables, classes, and methods in the code. I tried to promote this useful window to a major screen with no success. This is unfortunate because its default position requires me to expand the project tree to be much wider than it needs to be just to see enough of the Outline to be useful. The alternative is to place it in the tab group for debugging/consoles at the bottom or to create a new tab group just for it, which would consume valuable vertical space. On the other hand, the main content window has a Maximize button that makes it take up the full window size (in other words, all of the other toolboxes and tabs go away except for the main one), which makes the need to preserve space in that area a bit less pressing.

In terms of getting used to Ruby and Ruby on Rails, I adapted somewhat easily. I "got" Ruby on Rails much more quickly than Ruby itself; I think a number of factors played into this. For one thing, I have read a lot about Ruby on Rails. Another thing that helped is that it follows the MVC pattern that has not only become quite popular, but its terminology and usage has become fairly standardized lately. If you have been following this style of development, it should not take you too long to be cruising around existing projects with enough competency to edit them without getting lost.

Ruby itself, though, was a bit tricky for me. It is just enough of a C-like language to feel familiar and for me to want to try things that I would do in Java, C#, PHP, or Perl. However, it is actually quite different from those languages in many ways, not the least is its heavy undertones of functional programming. I can see why its adherents love it; within minutes, I was coming across some of the things that I really liked about Perl (without Perl's propensity to difficult-to-maintain code), while at the same time, being a proper object-oriented language.

3rdRail's handling of Ruby and Ruby on Rails seems adequate. Because I am new to this particular ecosphere of development, I cannot say with certainty how it stacks up against the way Ruby and Ruby on Rails developers are currently doing their jobs. I can really only compare it fairly to Visual Studio, and frankly, that is not a very fair comparison. Not only is developing for ASP.NET or a Windows console application (the best comparison is to Rails or plain Ruby development)  a very different experience, but Visual Studio is an extremely mature product. Yes, 3rdRail is based on Eclipse, but it is still a new product.

The code completion and inline help seemed to work fine. I liked the idea of the IDE having different task-based "perspectives"; the IDE only shows what is needed at any given time, which makes it not as busy as some others.

The bad

The Help File is fairly ugly and inconsistent with its presentation and definitely needs beefing up in some places. When I tried finding information about version control, it referred to a menu I did not have on my screen and did not mention why I did not have that menu.

The IDE put a light grey border around the last character of code in a code block to help you see the end of the block (or the beginning, if your cursor is on the last line of the block). This is a nice feature, but the outline is far too dim to be found when you are scanning the code. If you do not know where to look, you will not find it.

While the code completion worked fine, it was unfortunate that hitting [F1] with the cursor on a piece of code does not bring up the help for that statement. I expect that it is difficult for the IDE to determine the type of a variable (because Ruby is an interpreted language that determines type at run time), but I would expect, for example, the "puts" command (the Ruby equivalent to "print") to be something that I could get help on. When the IDE has an error, instead of providing a useful error message, it pukes some Java runtime exception nonsense back; if I wanted to debug Java code, I would be a Java programmer!

Overall, the only item that I think is an extremely serious issue is the lack of context-sensitive [F1] help. After that, I think that the 3rdRail team needs to focus on getting the Help system whipped into shape. This is less of an issue, because there are so many outstanding resources on Ruby and Rails to begin with, and because so much of 3rdRail is open source software that is documented elsewhere.

And the improvements

Originally, I was going to hit 3rdRail quite hard for its lack of a profiler, but in 3rdRail 2.0, the profiler is definitely there and documented. It uses the R Optimizer profiler. Additionally, the code editor now performs formatting in version 2.0, which it did not do in 1.2. The testing facilities are also significantly beefed up, and additional tools for working with Rails have been added.

The installation process in 3rdRail 2.0 is a significantly better experience than it was in 1.1 and 1.2. While I still needed to install the TurboRDK (a Ruby interpreter, debugger, etc.) separately, the installation felt much cleaner than the one I got in 1.X. On top of that, the auto-update was fairly broken in 1.1, but by 2.0, it is solid and reliable.

Overall impressions

I think that 3rdRail has its warts, but more importantly, it is a decent product with a bright future. Since I have been playing with 3rdRail in three versions (1.1, 1.2, and 2.0), I have gotten to see major improvements over a short period of time. If I were to base this review on version 1.1, I would be fairly negative about the product. Version 1.2 was pretty good, and version 2.0 adds the features that I expect to see in an IDE that really separate it from a language-aware text editor.

If you are a Ruby or a Rails developer in need of an IDE, this is definitely a product you will want to check out. If you do not work in Rails, CodeGear has also released Turbo Ruby. While I have not tried it, it looks to be 3rdRail without the Rails functionality at a significantly lower price. Both 3rdRail and Turbo Ruby are sold on a subscription basis.

My experience working with 3rdRail was so positive that it encouraged me to do something that I have been saying I would do for years now, which is to properly learn Ruby. I am going to try a novel approach (for me), which is to read a book about it from cover to cover, get a solid background in "the right way to do things," and work from there. This is a big leap for me; I do not think that I have ever actually tried to educate myself about the way a language works before jumping into coding with it. I have already bought a book, The Ruby Programming Language by David Flanagan and Yukihiro Matsumoto (the creator of Ruby) from O'Reilly. I look forward to keeping you updated as I explore Ruby in the context of 3rdRail and possibly Iron Ruby as well.

Related TechRepublic resources

J.Ja

Disclosure of Justin's industry affiliations: Justin James has a working arrangement with Microsoft to write an article for MSDN Magazine. He also has a contract with Spiceworks to write product buying guides.

——————————————————————————————————————————————————————

Get weekly development tips in your inbox Keep your developer skills sharp by signing up for TechRepublic's free Web Developer newsletter, delivered each Tuesday. Automatically subscribe today!

About Justin James

Justin James is the Lead Architect for Conigent.

Editor's Picks

Free Newsletters, In your Inbox