Wednesday, August 29, 2007

NetBeans Ruby IDE is Great

And this comes from an all time IDEA user...

I have been an active user of the IDEA Ruby plugin when developing with Rails. For some time now, the plugin has annoyed me greatly, as it seemed to leak quite a lot of memory and it was sloooow.

Looking at Headius' post on NetBeans Ruby IDE being the so-called "Bomb" and all the other fuss about the "oh so great NetBeans", combined with my current (bad) experience with the IDEA Ruby plugin, I decided to try out NetBeans Ruby IDE.

I do NOT want the all complete 152MB NetBeans download with UML modelling, SOA development and a lot of other crap. I just want Ruby and Rails support. Luckily, there is just such a download. The NetBeans folks release a nightly NetBeans Ruby IDE only download, which is only 19MB. Nice! And yes, you will want the nightly build to get interesting features.

Installation went smooth. Setting up a project went even smoother. Just pointed at the existing rails dir and NetBeans suggested the correct Ruby IDE. In addition, it has a nice feature, where you can choose to use JRuby, as the Ruby platform. That is very nice. Something IDEA does not have (yet, I think they are planning for it).

Starting up, it begins to index my Ruby installation ruby sources in addition to the project. After this, completion and type lookup begins to work.

My experience so far is that it works great. Compared to IDEA Ruby plugin, NetBeans Ruby IDE is very fast. Feature-wise, they seem to be on a par. Both seem to undergo heavy development in these times.

Of course, I miss knowing all the shortcut keys :-( For those IDEA users of you out there, that want to try this out, here is a small cheat-sheet to get you going (format: IDEA = NetBeans):
  • Goto class: Ctrl-N = Ctrl-O
  • Goto file: Ctrl-Shift-N = Shift-Alt-O
  • Goto declaration: Ctrl-B = Ctrl-B
  • Goto back/forward: Ctrl-Alt-Left/Right = Alt-Left/Right
  • Select in project view: Alt-F1 = Ctrl-Shift-1
I still miss Ctrl-E (view open files popup) and Ctrl-W (expanding, syntax-intelligent marking). Anyone know how to do that in NetBeans?

This all happened on Windows. I sold the idea about trying out NetBeans Ruby IDE to one of my colleagues, which happen to run on Ubuntu. The experience was not quite the same here. It actually crashed a couple of times, with the result of some lost changes. Not nice! Oh well, these are nightly builds :-)

6 comments:

tn said...

Hi there,
what is "expanding, syntax-intelligent marking" ?

For a set of additional keyboard shortcuts you may find interesting (such as the one to reformat your current comment), see http://wiki.netbeans.org/wiki/view/RubyShortcuts

tn said...

One more thing - to see the open documents (and switch to the most recent in most-recently-used order) hold the control key and press tab.

Per Olesen said...

Hi Tn, thanks for the input. Good link you provided there. And thanks for the info on ctrl-tab. Very useful. It replaces IDEAs Ctrl-E.

With respect to "expanding, syntax-intelligent marking". It was my name for what I see IDEA calls "Select successively increasing code blocks" in their default keymap reference.

It is a nice feature, where IDEA selects what's under the cursor while knowing about the syntax. So, when I am standing inside the string "foo" in the beneath code and type Ctrl-W:

System.out.println("foo");

IDEA will select (mark) 'foo'. Type ctrl-w once more expands to include the "'s. So know, '"foo"' is marked. One more ctrl-w expands selection to 'System.out.println("foo")'.

Simple example. Powerfull feature. And it works in all editors that IDEA knows the syntax of.

tn said...

Aha. If I understood correctly that's what ctrl-shift-. (and ctrl-shift-,) does in NetBeans; AST-based selection. (Btw I'm Tor Norbye, one of the NetBeans Ruby developers. If you run into any issues with the Ruby support I'd love to hear about it through one of the many feedback channels - see http://wiki.netbeans.org/wiki/view/RubyFeedback.

Per Olesen said...

Hi Tor,
I found AST-based selection to be bound to shift-alt-. and shift-alt-, on my nb installation. And yes, indeed that matches ctrl-w in IDEA. Cool!

Charles said...

I'm just like you, a hard-code IntelliJ guy but finding the Netbeans Ruby IDE to be superior so far. I'm wondering though why Ctrl-Tab doesn't show up in the Keymap editor, I would love to set it to Ctrl-E.