Who didn't switch to Rails?

I've been playing quite a bit with Ruby on Rails in the last couple of weeks, and I'm liking what I see. I watched the videos and bought the book, and I'm writing a web application in it now. I'll let you know how it goes.

However, before I get too deep into this; I have a question: did any java coders out there find a good reason not to switch?

My first impressions of rails are these: for the simple case it seems to make all of the annoying, difficult and boring boilerplate work of writing a web application just go away. For the not so simple case, it significantly lightens your load in all but the most esoteric cases. And even in the esoteric cases, chances are there's a Rails feature you're not using and should be; several times now I've caught myself writing ruby code to accomplish something, only to find that there's a handy function generated for me which does just what I need it to without any fuss.

Now, there might be seasoned veterans of the web application out there who are shaking their heads sadly, thinking: "There goes another java coder swallowed up by the hype. He'll be back within a couple of months."

Well, if you evaluated Ruby on Rails and didn't switch to the platform, I'd like to hear from you. There are plenty of websites out there bragging of the benefits of rails and begging readers to switch, but to my knowledge I don't think there's a list of reasons why someone wouldn't switch. This might be just because there aren't any good reasons... so let's see.

So, if you want to save me from turning to the dark side (as you see it), either get in touch direct, or leave a comment.

Comments

Well yes. Like I need all

Well yes. Like I need all that business logic available for my web application to be available also through HTTP remoting to a swing client and eventually to any client through web services. Also aside my business logic I do need a lot of business code auditing and cross cutting concern implementation (not logging btw :-)) ) that I cannot escape the AOP buzzword if I want my business logic code to remain sane. So you see I have not only ONE reason. There are several of them that I can think of right now. Then, when we'll go in production I swear I'll give you at least as many of them.

Grails - Reason #1

I too have been looking into Ruby as well as other scripting languages such as Python, PHP, Groovy and others. I read an article on Rails that almost had me hooked. The one thing that's holding me back is how different the syntax is. Now I'm not trying to turn this into a holy war of the languages but I do think that Ruby involves some very unique concepts that would take some getting used to. (Note: that's not a bad thing either, just a different thing.)

Back to the other languages I've been looking at. One language that has stood out in my mind more than others is Groovy. When I first looked at Groovy it looked downright awesome. However I was hearing a lot of bad things about it in light of its recent JSR at the time. Things like the Language would change dratically, it had no direction, it would ultimately fail, etc. That was well over a year ago and now that the language has formalized and stablized I think it's really a good time to evaluate it. To me, Groovy offers many of the same features as Ruby but in a more familiar Java-ish syntax. As a testimony to the similarity between Groovy and Java I wrote some sample Java compliant code and Groovy parsed it without a hiccup. I then slowly introduced (one at a time) Groovy features such as loose typing, closures, @Property declarations, and had a good ol' time doing so. It truly showed me the power of the language.

Why is that relevant? Well because of a Groovy project I saw linked to from the Groovy home page, Grails. Grails is the Groovy answer to Rails. While it's not as mature as Rails, it is very robust in its own right. Any Java developer considering Rails would do himself some good looking into Grails. I strongly feel this is a project with some huge potential. From what I see it offers most if not all of the initial eye catching features of Rails as well as one important feature that Rails lacks- native Java integration. Since it runs in a JVM you can do all of the same things that you can do with your JSP/servlets apps. I'd like to see your take on the Grails project.

Very interesting

Thanks for the link. I'll have a look at Grails; perhaps I'll do a full comparison as a new post.

I guess I should include a link huh?

In my last post I neglected to link to the project I was hyping...
Grails

There's too much excitement happening in the world of Java

I have to comment again out of frustration. I think there's just too much excitement happening in the Java community to warrant a switch to some other platform. It's natural for people to point the muddy finger at frameworks like EJB and Struts to stake claims that platform X is lighter/better. However, what's missing is a wide eyed look at all of the exciting things that have come to Java over the past few years. Along with Tiger, we've had the introduction of the Spring framework and other dependency injection containers that do away with the woes of EJB developement. There's plenty of light weight servers like HSQL and Jetty that could make creating packing and deploying a robust Java app as simple as a file copy. There's plenty of best practices frameworks such as the aforementioned Grails project, SwixAT, and Spring RCP that also go a long way towards removing the atrocities of traditional EJB developement. Then theres Eye Candy open source projects like Laszlo that can give your app that professional, prestine look. There's nothing wrong wth technologies like Ruby Rails and the like. I view Rails as an equal alternative or sibling in the realm of application developement to Java. Yes there are many good practices in Ruby Rails and the Java community is picking them up as well as adding there own. So before anybody goes poking fun at Java because of EJB and/or Struts bloat they should understand that Java is not just Struts or EJB, it's so much more and there no limit to what you can do with it.

Good points

You make some excellent points here.

The Spring Framework is indeed excellent, and takes away a lot of development frustration - I wouldn't even consider writing a production J2EE app that didn't use it.

I think that for a thick client intranet app I'd go for Spring RCP again. I enjoyed learning the framework and writing an app using it. It was (mostly) painless, and would have been a lot more difficult and time-consuming to write with native Java/Swing.

It's interesting that you say that the Ruby language stopped you switching. I'm finding that the Ruby language is both the biggest disadvantage and biggest advantage to Rails. It's a right pain to screw your head round an new language, especially one so different; but when you've done it, boy does it serve you well.

That's the one thing that I'm finding with Rails over J2EE/Spring that's currently winning me over. When I go back to maintaining my J2EE apps, I find myself in the middle of a 20 line function, having instantiated 2-3 iterator objects and done about 10 casts, thinking: "I could have written this function in two lines in Ruby."

It's Ruby, not Rails, that's likely to win me over.

Having said that, I'll look at Grails too. Having a Java back-end would certainly help for using useful third party jars - the java api base is astronomically large. I'll let you know what I find.

It's Groovy that's likely to win me over

Like I mentioned earlier, I almost bought into the Ruby language too with all of it's razzle and dazzle but at the same time I've been keeping close watch on Groovy. I like everything that I saw in Ruby but when I started to see the same things in Groovy I began to say, "Hmm... why switch entirely from Java?" I my opinion the drastic change in syntax didn't warrant what I'd lose in the runtime. When the same kind of tight concise code can be written under the Java VM I have to look for other reasons to switch. I have nothing against Ruby I just can't see much outside of syntatic sugar that would compell me to Dump Java just yet.

One other thing. I just had a great experience with the community behind Groovy this morning. I wrote the creator of the project an email regarding the Eclipse plugin not compiling from CVS. I naturally expected my email to get lost or disregarded with the notion of "why doesn't this guy use the mailing lists like everyone else?" One thing I'd like to mention is that a community is probably upwards of 70-80% of what makes a project successful. While I haven't dealt extensively with the Groovy people I can tell you that my first experience was very surprising and relieving.

In all I think both languages are very strong. I'd love to see a comparison (featurewise) between the two. Ruby may have a slight edge being a more mature product.

BTW, It's also worth a look at SwixAT. I feel that's another very interesting project that has it's head screwed on pretty tight. It takes advatage of the power of scripting, Spring injection and XUL UI definition mixing them all in one very appetizing stew capable of tempting even the diet concious programmer.