Netbeans Ruby Support: Check It Out

Cable CarToday at the JavaOne Community Day I saw a couple of presentations on JRuby and the NetBeans Ruby support. Mark’s already talked about the JRuby stuff, so I’m going to cover the NetBeans Ruby support. I’ve actually been playing with it for a week or so, but also got another demo at today’s presentation. Based upon my experiences and what I saw today, my key message is this: take a look.

A while back Charles Nutter (core commiter of JRuby) applauded NetBeans’ Ruby support. I was a little dubious given that he works for Sun now, but was nevertheless curious given that I was starting to get a little frustrated with the RDT and RadRails plugins for Eclipse.

So I downloaded NetBeans 6 Development Version and installed the Ruby and Rails modules. I was really impressed. Code completion definitely seems superior to RDT (a boon for the novice Ruby developer in particular) and the debugging actually works – RDT’s debugging seems to have gotten a little flaky, possibly because the project has stagnated a little bit whilst the Ruby language and implementation has moved forward.

With an interpreted language like Ruby, I have found graphical debuggers to be quite useful because you can look at the full source code for anywhere on the stack whenever you want. Whilst Ruby comes with it’s own command-line debugger, I find full graphical debuggers to be one of the key strengths of any IDE. And this is especially the case for language novices.

For example, if you don’t quite understand why your Rails app is working a particular way, you can set a break point in your code just before the relevant Rails code, then step right into it. No more staring at a compiled Java class wondering what’s going on inside of it

Speaking of Rails, support for Rails in NetBeans also seems really good – an existing Rails project just worked out-of-the-box for me. This is particularly impressive given that by default NetBeans uses JRuby. I only ran into trouble when trying to use a Rails plugin that used a Ruby native C extension – a known limitation of JRuby (although I do wonder whether some sort of JNI bridge might be able to get around this). So I configured NetBeans to use my native Ruby implementation instead of JRuby and it worked a treat.

My only question concerns refactoring support – or lack thereof. The guys demoed a nifty ‘Rename Variable’ refactoring today, but it’s the only one I’ve seen. I’m keen to know what sort of refactorings they are planning on building, especially given that dynamic languages like Ruby are harder for refactoring tools to work with. I know that Sun and the NetBeans team have done some serious work on automated Java refactoring – I wonder how much of this can be applied to Ruby.

It’s been a long time since I used NetBeans – last time was probably 4 or 5 years ago. Back then I was limping along with it because I knew of nothing better. Somebody pointed me to Eclipse and it just blew NetBeans away. I never looked back – until now. And ironically, Ruby – an entirely different language – has been the trigger. I haven’t even revisited the NetBeans Java support yet!

My NetBeans 6 installation is still a little buggy, but it’s nothing serious and it’s even possible that Sun have fixed the problems since I last downloaded a build. In fact, I wonder whether 6.0 final is going to be released to coincide with JavaOne (although in this age of the eternal beta, I’m not sure that major releases have quite the impact that they used to).

If you’re developing with Ruby, I highly recommend that you check out NetBeans and its Ruby support. And if you’re a Java developer wanting to take a look at Ruby and Rails, NetBeans seems like a pretty good way to get into it. I only hope that now that Aptana have taken over the RDT and RadRails projects, they’re able to get them up to par with what NetBeans now has to offer.

Warming up to JavaOne

javaone.jpg

Welcome to a series of blogs around the JavaOne conference in San Francisco, CA. Ben Teese and myself are here to rub shoulders with the greats of the Java community and hopefully learn some stuff.

Today is the CommunityOne day, which is really a warm up for the main thing which starts tomorrow morning. There were a few sessions based on some ‘tracks’, and I’ll mention one of them.

JRuby

JRuby is going version 1.0 “in hours” according to the two main contributors Charles Nutter and Tom Enebo. JRuby is a key to bringing together both the power of RoR and Java. To be able to talk to any Java code from Ruby ensures that RoR can leverage existing application code. In addition, JRuby provides a deployment path for Ruby that doesn’t currently exist. JRuby is a key technology, especially for a company like Shine that works deeply in the Java world and needs to help clients to use existing assets whilst adopting newer technologies that can deliver better business benefit.