Pivotal Labs

Main menu

Skip to primary content
Skip to secondary content
  • About
  • Case Studies
  • Team
    • Executives
    • Locations
      • San Francisco (HQ)
      • Boston
      • Boulder
      • Denver
      • London
      • Los Angeles
      • New York
  • Community
    • Blogs
    • Tech Talks
    • Events
  • Careers
    • Lifestyle
    • Principles & Practices
    • Benefits
    • FAQ
    • Apply
  • Tools
  • Contact
    • Press Room
    • Press Releases
    • In The News
    • Press Kit
  • All
  • Labs
  • Standup
  • Tracker
Chad Woolley

The Great Ruby IDE Smackdown of '09

Chad Woolley
Thursday, July 16, 2009

In a recent thread on the East Bay Ruby Meetup list, several people chimed in with Ruby IDE suggestions. I suggested RubyMine, which we use at Pivotal. Several people mentioned NetBeans and Aptana RadRails, so I decided to have a little contest.

Now, if I am going to work in an IDE and sacrifice the speed of a text editor, I want to see it work for me (’cuz RubyMine can chew through all your CPU and RAM and then some faster than you can say Moore’s Law). That means understanding Ruby, and using that information to save me some significant thinking and work.

I don’t mean code-generation macros or dumb context-aware keyword-completion, I mean something useful like knowing where my classes and methods are. In my book, that leaves out Emacs, Vi, and even TextMate, regardless of their other merits (sorry people, I like text editors too, but I’m making up this test – flame away, the comments section is below).

So, here’s the smackdown scenario:

  • Download the latest NetBeans, RadRails and RubyMine.
  • Open a Ruby project, this example is one of mine (I wrote this three years ago to learn Ruby, so don’t make fun of me for doing dumb stuff…)
  • Test the ability of the IDE to navigate through Ruby language constructs. This should be easy, it is a command-line app using a Dependency Injection architecture, no metaprogramming curveballs!
    • Open the root Ruby class for the project (lib/geminstaller.rb)
    • Pick a variable (app in self.install)
    • Try to work back to the class declaration (GemInstaller::Application) using IDE navigation (Command-click in all the IDEs, although sometimes they ignore you)

Result? RubyMine succeeded, NetBeans and RadRails failed miserably. Here’s what happened in each:

NetBeans

  1. Click create_application class method reference in app = create_application. NetBeans takes me to the method declaration in same class.
  2. Click the app method in registry.app.

FAIL! ANGRY BEEP! app is an attr_accessor on another class, NetBeans can’t find it.

RadRails

  1. Click create_application class method reference in app = create_application. RadRails takes me to the method declaration in same class.
  2. Click app method in registry.app. RadRails takes me to the attr_accessor on the Registry class (without a prompt, and highlighting the symbol, which is even better than RubyMine).
  3. Click (and F3) on the :app symbol argument to attr_accessor.

FAIL! ANGRY BEEP! RadRails can’t figure out the symbol parameter to attr_accessor. It says “Current text selection does not resolve to a Ruby element”.

RubyMine

  1. Click create_application class method reference in app = create_application. RubyMine takes me to the method declaration in same class.
  2. Click app method in registry.app. RubyMine pops up a dialog asking if I mean the attr_accessor on the Registry class, or the local variable I’m declaring. That’s rather silly, I admit, but the point is it followed the reference to another class.
  3. Click on the attr_accessor choice. RubyMine takes me to the attr_accessor line in Registry.
  4. Click on the :app symbol argument to attr_accessor. RubyMine takes me to the point where the @app instance variable is initialized.
  5. Click on the Application class name in the GemInstaller::Application.new constructor invocation. RubyMine pops up a dialog asking if I mean the Application class in my application, or two other Application classes that happen to be in my Ruby installation. This is also a silly question – it should have known the correct choice because of my namespacing, but it still found the class.
  6. Click on the GemInstaller:Application choice. RubyMine takes me to the class declaration.

SUCCESS! RubyMine drilled all the way to the class declaration, even through an attr_accessor, albeit with a couple of stupid questions.

Summary

I personally think this is a Big Deal. In the past, I’ve mocked Ruby IDE functionality as a poor simulacrum of the vast power in Java IDEs. When using Eclipse in Java, I could perform epic refactorings, extracting superclasses and adding parameters to method signatures; refactoring scores of classes across multiple projects in a few mighty keystrokes. Yes, I’m fully aware that this is because Ruby is a dynamic language, but that doesn’t make me miss a real refactoring IDE any less, and others have long lamented these shortcomings, as well.

So, for years, even though I’d always indulge my pairs if they wanted to use an IDE, I’ve done all my personal hacking with a fast, lightweight text editor and command line tools. To me, the benefits of a memory- and processor-sucking IDE with tons of unnecessary, unconfigurable, resource-eating tiny-ass-fonts and chrome did not justify giving up the speed and responsiveness of a great text editor.

However, RubyMine can now navigate code for me. I don’t have to think and manually find that class, RubyMine knows where it is. Granted, that ain’t no Extract Superclass, but it saves me a lot of thought and time, both of which are increasingly rare commodities for me.

To be fair, this is really just a problem related to parsing and interpreting attr_accessor declarations, and I expect that NetBeans and RadRails will pass this test as well in another release or two. That’s all great news, because it means that Ruby IDEs are finally, slowly, coming of age. I think I’ll still be waiting a long time for an automated Modify Method Signature refactoring, though…

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Ryan Dy

Standup 02/18/2009

Ryan Dy
Thursday, February 19, 2009

We’re looking for more information about Taste or other similar kinds of suggestion engines. What kind of experiences have people had integrating these tools into Rails applications. Are there other useful engines worth looking at?

Direct uploads to Amazon S3 service can be serviced by EC2 servers; however, there might be more direct ways of doings this with S3.

Newer versions of RubyMine have been reported having problems running the gem version of rspec but a solutions has been found. The problem comes from the way gems are specified in RubyMine. You need to add the rspec gem you are using to the Project Structure >> Ruby SDK and Gems.

Using Desert and exception notifier can cause some slow startup times. If you are seeing this problem try moving exception notifier’s sender_address inside your environment’s post-load block.

  • 0 Shares
  • Share on Facebook
  • Share on Twitter
Edward Hieatt

Back in the land of the living (or: How RubyMine makes me happy)

Edward Hieatt
Wednesday, December 17, 2008

How my outlook on coding in Rails has changed over the past few months!

When I made the switch from Java to Rails a few years back, I, like many of my fellow Pivots making that same well-chronicled transition, delighted in the ease with which we could suddenly knock out a web app. How we cheered when our object-relational mapping took zero lines of code! How we applauded when we declared our model object validations in near-English! How we roared with laughter when convention viciously slapped the face of configuration! And how we shook our heads in dismay when we realized that our new development environment appeared to be from the mid-, if not early, nineties.

For, while we had arrived in a brave new world of minimalist declarative meta-programming, rapid prototyping, and an new-found sense of productivity that made even the most nimble forms of Java development look like wading through a morass of slimy boilerplate code and endless XML, we soon realized that the IDE situation was less than awesome. Our productivity was overall much improved, but we had taken a huge step backwards when it came to the act of writing – and especially changing – code and tests. Overnight, we went from living it up in a paradise of automated refactorings, seamlessly inbuilt test runners and powerful debuggers to roughing it with a text editor that, to our spoilt eyes, appeared to offer barely more than code highlighting and support for homemade macros.

Not only didn’t our favorite Java IDE, IntelliJ, not function well with Ruby, but nor did Eclipse, and nor did NetBeans. Early on, each had some nominal support for Ruby, it’s true, but it was mostly just code highlighting and some basic navigation. If we wanted to run a test, we had to (horror of horrors) leave our IDE, go to a shell and run a command (mapping a key to an “external tool” was cold comfort, it seemed to me). If we wanted to rename a variable, we had to do it manually. And if we wanted to debug something, well, the only option was to use a tool that appeared so prehistoric that we simply didn’t do it.

In fact, things were so bad that if we were honest with ourselves, TextMate sometimes looked like a better option that the IDE we knew and loved. We pleaded with Pivots who didn’t come from the world of Java to use IntelliJ, if only (for them) for its awesome global search, and if only (for us) to make ourselves feel comfortable in the new world of Rails. But IntelliJ had been rendered so impotent by its Ruby Kryptonite that it felt at times as if we were simply dragging around a comfort pillow that had lost its stuffing. All the progress that had been made in the world of Java IDEs for so many years seemed to have been lost. Woe was certainly us.

But then came some signs of life. NetBeans and Eclipse (in its various forms) were making progress in Ruby-land: they had test runner integration and debuggers that worked. Big steps forward indeed. While I suspected that I would probably miss IntelliJ, I nevertheless gallantly tried to commit to one of them: if they were going to offer me something even close to the power I used to have in my Java IDE, I was willing to put up with a lot. But despite my best attempts to be patient, I was disappointed time and time again. Eclipse still felt clunky compared to IntelliJ. NetBeans still suffered from a problematic global search and less-than-perfect VCS integration. They are gallant attempts, and they deserve credit. They’re both great products and they both serve communities that no doubt find them invaluable. But in that very unquantifiable, personal, emotional way, they weren’t what I really wanted. I wanted that IntelliJ feel.

So where was JetBrains on this? There was the Ruby plugin for IntelliJ, which was making some great strides forward, but that always felt like a bolt-on solution at best. What was more, it often didn’t work with new IntelliJ updates.

Imagine my surprise and delight, then, when Christmas came several months early this year. Suddenly, in late 2008, we are quietly presented with RubyMine. IntelliJ for Ruby? Surely not! I dared not hope for too much when with some trepidation I downloaded an early pre-EAP candidate a few months ago. But, joy of joys, it turned out that it was, or rather, is gradually becoming, (almost) all I was hoping for. Built-in test runner, debugger, pretty good refactorings – all things that other IDEs provide, but in that special JetBrains way that is so much more intuitive. Great success!

Now, I realize that all this probably sounds like a gush of praise that is not yet due, and perhaps that’s true. It’s certainly true that there’s a long way to go: RubyMine is lacking in many ways. But the signs are there that things are moving hastily in the right direction. Recently, each build that has come out has been noticeably better to me than the last (additional useful features, stability, performance). But more importantly, I feel like JetBrains is on the right trajectory with RubyMine. We now have a path towards a great IDE for Rails. I think we’re back in the land of the living, and I’m hopeful that between Rails and RubyMine our productivity will soon jump higher than we could have imagined just a few years ago.

OK, start the “All you need is Emacs”, “VIM is the best thing ever”, and “TextMate rocks, what’s this IDE nonsense?” comments below :)

  • 0 Shares
  • Share on Facebook
  • Share on Twitter

Topics

  • agile (783)
  • rails (117)
  • testing (90)
  • ruby (86)
  • ruby on rails (71)
  • jobs (62)
  • javascript (59)
  • techtalk (44)
  • ironblogger (42)
  • rspec (39)
  • bloggerdome (34)
  • productivity (34)
  • activerecord (30)
  • rubymine (30)
  • git (29)
  • gogaruco (29)
  • nyc (27)
  • design (24)
  • mobile (23)
  • pivotal tracker (22)
  • process (21)
  • cucumber (21)
  • jasmine (19)
  • ios (18)
  • tracker ecosystem (17)
  • webos (17)
  • objective-c (17)
  • fun (16)
  • android (16)
  • palm (16)
  • ci (16)
  • "soft" ware (16)
  • bdd (15)
  • tdd (15)
  • cedar (15)
  • rails3 (14)
  • performance (14)
  • css (14)
  • gem (13)
  • mouse-free development (12)
  • selenium (12)
  • goruco (12)
  • bundler (12)
  • api (12)
  • keyboard (11)
  • meetup (11)
  • railsconf (11)
  • nyc-standup (11)
  • capybara (10)
  • mac (10)
Subscribe to ide Feed
  • About
  • Case Studies
  • Team
  • Community
  • Careers
  • Tools
  • Contact
  • Labs
  • Events

Contact Us

contact@pivotallabs.com
+1 415-77-PIVOT
TwitterLinkedInFacebook

Pivotal Tracker

Tracker is the award-winning agile project management tool that enables real-time collaboration around a shared, prioritized backlog.
Visit pivotaltracker.com >