Is Ruby Replacing Java? — Not So Fast
Okay, I have heard it all: Ruby On Rails (RoR) is so much cooler and simpler than Java EE. It allows you to write web applications 10X faster. And Ruby has nifty language features we can only dream of in Java. So, Ruby must be replacing Java to become the “next” programming language just as Java “replaced” C++/COBOL and C++ “replaced” Fortran. Well, in my opinion, this kind of talk has some serious logical problems.
First of all, as the short history of high technology has proven again and again, the “superior” solution does not always win over “inferior” ones. In fact, the opposite is more likely to be true. The question regarding to Ruby versus Java is NOT how much more advanced RoR is compared with Java EE — the real question is whether Java EE is good enough for most developers. The reason, in economics terms, is that the choice of a technically “better” programming language does not bring you competitive advantage in terms of overall cost and productivity. Instead, it matters far more to have better requirement gathering, better customer feedback, better development process, better trained developers, and better development tools (e.g., IDEs). In software engineering speak, the actual implementation of a system using a specific programming language has the lowest value in the value chain, and can be easily outsourced.
Okay, now you may ask: “If that is true and programming language does not matter, how come Java became so successful and replaced an array of older languages?” Well, did Java really “replace” any other language? I have recently been in graduate school for a science PhD program, and all the new bleeding-edge number crunching software we wrote was still Fortran. It is not being replaced by C++ or Java. Fortran is good enough and switching to a cooler language does not make scientific computing better / faster — and the re-training cost for the entire team eliminates any potential productivity gain. Another example: for rich UI application developers, the dominant languages are still C / C++ / VB. Even heavily marketed languages like C# and VB.Net have little traction — let alone Java. So, my observation is that one language does NOT replace another one. The rise of a new programming language always comes with the opening of a new application area and an influx of new developers who are willing to try out a new language — since there is simply no incumbent language in this brand new area.
That is, you need to grow the big pie to make room for new languages. Fortran rises with scientific computing; Cobol rises with business computing; and Java rises with web applications. Is there a brand new computational field opening up for mass Ruby and RoR adoption? No. The software industry is not on the verge of another big expansion.
Now, Ruby is good at simplifying the development task for an already simple problem — build simple database driven web applications. I firmly believe that Java is already good enough in this area. There is nothing a RoR web site can do that a Java web site cannot (Granted, there are things the Ruby language can do but Java cannot. But that does not concern web users in front of a browser). Java just takes a little more time for *beginners* to get started, and it scales to the high end and legacy applications. The cost to re-train the developers for RoR (language, framework and IDE tools) would not really justify the productivity gain. And work-arounds to scale RoR applications could be very costly. Having said that, of course, Ruby and RoR are important technologies to learn in two aspects:
+ The most important impact Ruby/RoR will have is to drive the innovation in Java EE — much the same way C# drives the Java 1.5 innovation. We are already seeing this happening.
+ For people who need to build many web sites quickly, e.g., consultants and startups, Ruby/RoR is a great tool to try out the ideas and get a quick beta/prototype to the market.
So, while I encourage every Java developers to learn Ruby / RoR, I do not think it will replace Java in web applications. Anyway, just my 2c.
October 1st, 2006 at 6:27 am
There’s one thing RoR has going for it that might propel it past Java for Web applications: focus. Java has more Web frameworks than you can shake a stick at, and none appear to be head-and-shoulders more popular than the rest. It wouldn’t surprise me if there’s 4 or 5 with 10%+ mindshare, and another 4 or 5 with 5%+ mindshare.
RoR is pretty much it in the Ruby space. In fact, RoR seems to have gone out of its way to make it easy to extend with things that Java frameworks have provided (e.g., authentication/authorization) and things that Java frameworks haven’t (e.g., acts_as_taggable, which in one statement transforms a model class into one that has an associated “tag soup” or “folksonomy”).
If RoR attracts enough bright developers, it could blow past the Java frameworks in terms of breadth/depth of features and capabilities. The Java frameworks could match, but there might not be enough critical mass around any one of them to keep up the pace. It’s not there today (for example, Java frameworks tend to have broader database support), but it’s downright astounding what that community has achieved in a short period of time.
As a result, even if one or more Java frameworks emerge (or are rewritten) with RoR’s ease-of-use, RoR might still wind up more widely used, because they garnered “escape velocity” at a time when the Java frameworks were so fragmented.
October 1st, 2006 at 1:12 pm
Thanks Mark for the thoughtful comment. Yes, I do agree that RoR is a stuning success and it really exposes the unsatisfactory current state of Java web frameworks. But I am not sure if I argee with the “less choice” == “less confusion” == “better platform” logic … If that were true, ASP.Net would have beaten Java EE a long time ago.
December 12th, 2006 at 2:24 am
Michael,
I’m not sure where your numbers are coming from, but several claims that you make have dubious value - the latest one being “if that were true, asp.net would have beaten java EE a long time ago”. Do you have numbers that show that Java webserver penetration is actually higher than asp? I know of studies showing more apache servers than IIS, but I was unaware of java EE vs asp.net. Anyhow, I digress.
First, stuff that I agree with:
1. Actual implementation and implementation language has a lower cost (and associated risk) than things like gathering requirements. I completely agree.
2. There is nothing that JavaEE cannot do that RoR can. Of course. In fact its the other way around. RoR doesn’t do a bunch of stuff that JavaEE can. Important to me are aspects of scale out and clustering that go with the much more established J2EE servlet containers and servers (tomcat / BEA) that RoR does not have (or to the best of my rather patchy knowledge).
Second, stuff that I do not agree with:
I think you’re missing the point here. The idea with RoR is to solve one problem and solve it well (database backed sites). Extending it to do other stuff is fine, but its outside its core competency. RoR optimizes on one thing and one thing alone - developer productivity writing and maintaining the code. This is what is terribly important and something that java gets 100% wrong. The sheer amount of *stuff* that I need to get a simple jsf website up is mind-boggling. There is eclipse and a myriad of eclipse plugins, not all of which work well with each other. Then there is tomcat and getting tomcat to play well with eclipse on windows (my dev platform of choice). Then the database and appropriate drivers for those. And this is before I’ve started writing a _single_ line of app code.
Presumably this is one time cost that you have to pay to get started and it gets made up in productivity later on. I don’t know. I have played with RoR and python and love them but I haven’t done any serious development with those. I just feel that your arguments and your case for J2EE misses the point - the problem is not that it is any less powerful, the problem is that its too powerful, too complicated with too many options, most of which are completely useless until i have a few million people hitting up the webpage per day. Getting those options right is really hard to the point where you have hundreds of untyped xml files controlling configuration all of which need to be changed in sync. Ugh ugh ugh.
Someone please write yet-another-layer on top of the 100 layers that J2EE has already to make it easy for me to go from nothing to website, just like in ruby / python.