Thursday, June 19, 2008

JRuby on Rails good or bad for Java?

I am going to apologize for the incendiary title. I think the work the JRuby team has been doing at Sun, particularly with enhancing the JVM for dynamic languages, is great and a service to the entire Java community. The real point of this post is a question to Sun and the rest of the Java community. What is the question? Simple. Y'all why all the emphasis on JRuby and JRuby on Rails and not an equivalent amount of love (read: attention/resources) to the Groovy/Grails platform? I am combining consideration of both Ruby and Groovy with their equivalent Web frameworks RoR and Grails since they really are the killer apps (read: primary motivation for developers to try them) for both languages at this time.

So why all the attention at Sun to JRuby? Well I think there is probably a mentality at Sun to think they need to win more people over to the Java platform. That thinking leads them to wanting to support Ruby and Ruby on Rails on the Java platform. This is not the end of the world or necessarily bad thinking. Why? Well you would think the more developers on the Java platform the "mo' better" right? I admit that being a Groovy/Grails proponent, the attention leaves me a bit jealous, but as I said earlier, they have been doing good work and, you know, envy gets you nowhere. Still it begs the question, what about the people who are already on the Java platform doing their work? What is being done to improve their experience and to keep them happy working with the Java platform?

Note: I keep referring to the Java platform since Java really encompasses three components, the JVM runtime, the platform libraries and the Java language. I think of the platform as the libraries and the JVM, in other words, the full Java runtime minus the development time Java language support.

Give Groovy Some More Love Everyone!
Groovy/Grails is native to the Java ecosystem and should be (read: is) easier to support on the Java platform. Groovy/Grails has a far flatter (read: easier) learning curve for existing Java developers. How do I know that it is an easier learning curve? Simple, Groovy is the single reason I have not really tried to do development work in Ruby or another dynamic language. Every time I started to drift off the reservation, for one reason or another, I found that Groovy had it already. So why give up the JVM or platform libraries of which I am very familiar? Grails, the Groovy Web Framework, is still a relatively young technology, but is already showing signs of being one of the, if not the, best Java web frameworks out there. It is amazing how Grails is picking up speed right now. <sarcasm>Its like people want a better way to do Java Web applications and, get this, don't seem to be willing to dump all their previous experience with Java or their previous Java work in the trash. Isn't that just crazy??</sarcasm>

So therefore, I think Groovy/Grails is something that should be better supported, particularly with tooling. A better Groovy/Grails would help keep developers on the Java platform, how? Well remember there does not exist a Groovy/Grails platform outside the JVM and Java platform libraries.

Besides the fact that Groovy/Grails support should be far easier to achieve than Ruby/RoR support, there is the converse argument about JRuby and JRuby on Rails (JRoR?) bringing people to the Java platform. JRuby on Rails could also be viewed as a conduit for allowing development to leave the Java platform as well. Why? Well all new work could feasibly be run on native Ruby platforms if run on JRuby and, in fact, would probably run better on native Ruby platforms than inside the JVM. So unless you have lots of legacy with J2EE, there would be no hook to staying with the JVM or Java platform. Now I hate vendor lock-in, but Java has no vendor to speak of. I am all for allowing existing Ruby/RoR developers to try the Java world, but the question is where should your emphasis lie? I don't think that the Ruby world is anywhere near the size of the Java world, even on the Web.

So, in conclusion, the question is, is it more important to convert others to the Java platform or is it more important to keep and take care of the large Java developer base on the Java platform? My answer is yes. What do I mean? Well you can't just grow a community, you must also take care of what is already there, both aspects are important to a thriving community.

So please Sun, get past the NIH (Not Invented Here) syndrome and go hire a Groovy guy next to Mr. Nutter (no complaints for Mr. Nutter, he has been doing good stuff on the JVM for all dynamic languages). While you are at it, I am going to suggest (even though I am an Eclipse guy) putting better support in Netbeans for Groovy. I am getting a little tired of hearing how IntelliJ is by far the best environment for writing Groovy. I would also suggest improving the Eclipse plugin, but I don't think y'all will go for that(would you?). Any help to Groovy would be in your interests, you wont regret it.

For the rest of the Java community (especially the Groovy/Grails subset), I think I am going to start sounding like Public Broadcasting in the United States during sweeps. If you don't know what I talking about, they are officially called "Pledge Drives", unofficially they are called "Beg For Money Drives." So here goes in my PBS pledge drive voice**:

"Please pledge your support to Groovy Eclipse today. At the 1+ full-time developer level we'll get you an Eclipse mug and sticker. Show your Eclipse pride everywhere you drive or compute, your choice. At the 2+ full-time position level, in addition to the mug and sticker, we'll get a Groovy Eclipse shirt made up for you from somewhere. You know you have been enjoying Groovy/Grails for some time now and been looking for your opportunity to contribute, here is your opportunity. You wont regret it, I promise*."

Seriously, the Java developer world today is on Eclipse (not IntelliJ or Netbeans or whatever), so for Groovy/Grails to grow and be taken seriously by the vast majority of Java developers, Groovy Eclipse has to be first class. Like I overheard once while talking about this subject to a group of people, "People will change languages faster than they will change their IDE(s), so for me to introduce Groovy to my Java developers, I need it on Eclipse."

* If you do regret it anyway, just remember two things. First, I thank you for your support. Two, you may rant and rave at me, but limit it to emails, no 2am crank calls, please. :)

** I think I watched way way too much PBS as a child or something, but where else could I watch Dr. Who before the Sci-Fi network existed??

4 comments:

Śliwa Andrzej said...

Im working 6 year as java developer, but I think JRubyOnRails is good for Java. Java must evolve to be a platform not only language. Is only one reason for not learning of Ruby, and not using this language on Java platform, is laziness. Groovy ... is semi Java language .. add is based mostly on Ruby. I don't like solution ... based on other solutions for ex. CakePHP, Sails etc. I like Rails for complete eviroment to developing, testing and migrating ecosystem in one simple convetion way. Groovy is for me spagetti ... many not designed for him libraries and technologies. Many new futures must be invented not copied.

James E. Ervin, IV said...

Thanks for the comment. Like I said in the initial paragraph, the title is incendiary. My point was that the Java community should give Groovy and Grails more attention and resources since in my opinion it is a much much better fit for existing Java developers. Your mileage may vary, but from what I have both seen and experienced this is the case.

Anonymous said...

Good post! The other question to me (kind of on the opposite end) is "When is Sun going to completely just give investing so much time in any language and instead focus on being a services company?" They can't be making much money on Java or JRoR anymore, so when will these be completely weaned?

Anonymous said...

I meant "give up" not "give"