Welcome!

Java Authors: Jerry Melnick, Michelle Drolet, Liz McMillan, Andreas Grabner, Elizabeth White

Related Topics: Java

Java: Article

Michael Yuan's Java Blog: "Is Ruby Replacing Java? – Not So Fast"

"I do not think [RoR] will replace Java in web applications."

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.

    More Stories By Michael Juntao Yuan

    Michael Juntao Yuan is a member of JDJ's editorial board. He is the author of three books. His latest book, "Nokia Smartphone Hacks" from O'Reilly, teaches you how to make the most out of your mobile phone. He is also the author of "Enterprise J2ME" - a best-selling book on mobile enterprise application development. Michael has a PhD from the University of Texas at Austin. He currently works for JBoss Inc. You can visit his Web site and blogs at www.MichaelYuan.com/.

    Comments (0)

    Share your thoughts on this story.

    Add your comment
    You must be signed in to add a comment. Sign-in | Register

    In accordance with our Comment Policy, we encourage comments that are on topic, relevant and to-the-point. We will remove comments that include profanity, personal attacks, racial slurs, threats of violence, or other inappropriate material that violates our Terms and Conditions, and will block users who make repeated violations. We ask all readers to expect diversity of opinion and to treat one another with dignity and respect.