Browse by year:
Ruby vs. Java Conundrum
Vineet Tyagi
Friday, February 1, 2008
The Ruby language and Rails framework have been gaining rapid prominence and are fast becoming development platforms of choice for many Web 2.0 applications and sites. This rapid augment is raising questions on the abilities and applicability of Java technologies for particular kind of products. Some visionaries and early adopters of Ruby and Ruby on Rails frameworks have already sounded the death knell for Java.

Java refers to a number of products and specifications that together provide a system for developing and deploying cross-platform applications.

Java has gained enormous popularity since its first appearance. Its rapid ascension and wide acceptance can be traced to its design and programming features - particularly Java’s capability to enable one to write a program once and run it anywhere. Java is one of the first programming languages to consider security as part of its design and you can often get software for free.

Security measures cannot be implemented with any degree of assurance without a reliable framework for program execution. Java provides multiple levels of reliability measures, beginning with the Java language itself.

Java Pros
* Java offers choice and the population of Java programmers is huge.
* Java open source projects exist across a wide spectrum of problem spaces and fill many different niches. With Java, you can often get software for free which otherwise one will have to build himself or pay for. Java has a thriving open source community.
* Java is often the safest choice.
* Java is scalable. We’ve learned enough from our experience to build applications that scale.
* Java Technology is mature and provides proven solutions for enterprise level problems such as Two-phase commit, and distributed objects.

Java Cons
Like any programming language, Java also has its own set of drawbacks.

* The Java Platform Is Weakening.
Successful programming languages seem to emerge every decade or so. Bell Labs developed the C programming language in the early 1970s; AT&T released C++ in 1985, which slowly subsumed C because it had features allowing object-oriented programming. Sun released Java in 1996, and it rapidly emerged as a popular language for Internet development. Java has been growing steadily ever since. Rustic logic dictates we’re due for a new programming language by now, and Java’s decline should start soon.

* Complexity:
Java’s complexity is increasing. After a succession of complex frameworks, Java vendors embraced EJB, the most complicated version imaginable for web services and XML. EJB vendors redesigned it from scratch twice, forcing significant migrations on their customers.

* Availability:
In a 2003 study, Wily (http://www.wilytech.com/news/ releases/031120.html) reported that J2EE performance and availability were generally average to poor.

* Competition:
In February 2005, IBM announced consulting support for PHP. Ruby on Rails recently passed 500,000 total downloads. Peter Yared, Sun’s previous application server CTO (http://www.theserverside.com/news/thread.tss?thread_id=36129), predicted that J2EE would lose to LAMP (an open source software consisting of Linux, Apache web server, MySQL, and a dynamic language such as Python, Perl, or PHP).

Ruby is a reflective, dynamic, object-oriented programming language. It combines syntax inspired by Perl with Smalltalk-like object-oriented features, and also shares some features with Python, Lisp, Dylan, and CLU. It is a single-pass interpreted language.

Ruby Pros
* Productivity: Ruby and Ruby on Rails have higher productivity, measured as Lines of code per feature size and time taken to build features.
* Short ramp up times: A well motivated and experienced team can start working on RoR platform in less than a week’s cross training.
* A large number of industry visionaries support Ruby. The list includes
- Martin Fowler, chief scientist at ThoughtWorks
- James Duncan Davidson, creator of Ant and Tomcat, is now using Rails within a start-up to develop a web-enabled rich application that will be the primary offering of that company.
- David Geary, key designer of several successful web development frameworks, including JavaServer Faces (JSF), who speaks on and blogs about Rails regularly.
- Richard Monson Haefel (once one of the two votaries for the Java Community Process or JCP), who recently led the Burton Group in a discussion about Ruby on Rails as an important emerging technology with high-profile U.S. companies. He has also published a paper about using Rails with Oracle.
* Ruby and Ruby on Rails have higher productivity, which leads to other benefits.
* More productivity leads to a reduction in the number of developers per project and lowers management costs.
* Effort on communication for small projects is less.
* When development of applications get finished sooner, their value also gets delivered to the businesses sooner.

Ruby Cons
* As a new language Ruby could possibly stagnate, which could make scarce resources even harder to find.
* We don’t have much definitive proof of the ultimate scalability of Ruby as there are not many deployed Ruby applications around in production yet.
* The Ruby community is not so well established as the Java community; hence it’s harder to find third-party components, frameworks, education, and services.
* Ruby is less structured than Java and has fewer automated features to protect applications from abuse. This flexibility is both strength and a weakness.

The Ruby and RoR platforms are much better suited for particular types of web applications and sites where application programmers can control the database. Java technology platform is proven and it addresses issues like two phase commit and distributed objects well.

The equations may change in future; Ruby platform has a high chance of overtaking the Java platform to become the choice for building all types of applications. The following factors are conducive to making Ruby replace Java in the long run:

* Network ubiquity and the increasing bandwidth change the dynamics and the premises on which the distributed architecture principles were built. Thin client and layered architectures were necessitated for conserving network bandwidth and reducing network traffic due to latency. In a world with fast and fat pipes of connection these premises would not hold good anymore. This tilts the balance in favor of Ruby and RoR.

* CPU cycles and memory are becoming ridiculously cheap. Performance and scaling up will potentially be lesser of an issue as one could use more hardware to scale up applications without having to take on a huge cost burden. This again tilts the balance in Ruby’s favor.

Java Websites:
1. http://java.sun.com
2. http://www.sitepoint.com/article/java-language-basics
3. http://www.javaolympus.com/
4. http://www.leepoint.net/notes-java/index.html
5. http://javaboutique.internet.com/tutorials/Basics/

Ruby on Rails Websites:
1. http://www.tutorialspoint.com/ruby-on-rails/index.htm
2. http://www.fincher.org/tips/Languages/Ruby/
3. http://www.sitepoint.com/article/learn-ruby-on-rails
4. http://rubylearning.com/satishtalim/tutorial.html
5. http://www.rubyist.net/~slagell/ruby/
6. http://www.math.umd.edu/~dcarrera/ruby/0.3/
7. http://wiki.rubyonrails.org/rails/pages/Tutorial
8. http://www.troubleshooters.com/codecorn/ruby/basictutorial.htm
9. http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html

The author is Associate Director of Engineering, Impetus Technologies. He can be reached at vineet.tyagi@impetus.co.in
Share on LinkedIn