Why you should start learning Ruby on Rails

By Greg Moreno  Last updated Jul 22, 2006

View Comments   Render Printable

Ruby on Rails (or RoR) is a web-application framework that is rapidly gaining acceptance among web application developers. Even Java and PHP experts are recommending Ruby on Rails because of its capability to build applications with less time and effort compared to Java and PHP.

Ruby on Rails (or RoR) is a web-application framework that is rapidly gaining acceptance among web application developers. Even Java and PHP experts are recommending Ruby on Rails because of its capability to build applications with less time and effort compared to Java and PHP.

While it is true that Ruby on Rails is still not as popular as Java and PHP, there is a growing online Filipino community evangelizing its use, and several companies have been started with Ruby on Rails as its platform. There is also the demand for outsourced projects from the US and Europe who are looking for Ruby on Rails developers.

Ruby on Rails is a web-application framework written in the programming language Ruby. Ruby is a high-level, completely object-oriented programming language designed and written primarily by Japanese Yukihiro Matsumoto (or 'Matz' in the open-source community). It is has seen an increasing adoption from programmers (especially in the US and Europe) because of its clean and elegant design.

Ruby on Rails is full stack framework with all the necessary infrastructure API to build web applications already available - database interface, request-handling, view templating, email and web-services. Ruby on Rails has been featured in Dr. Dobb's Journal and a Linux World Journal issue was dedicated to it. Its primary author, David Heinemeier Hansson, has received the coveted 'Hacker of the Year' award from Google and O'Reilly last year.

Why Ruby on Rails?

Ruby is very easy to learn

The programming language Ruby is a big factor in the success of Ruby on Rails although RoR by itself has great merits. Ruby has a simple and brief syntax that makes it easy to use by programmers. If you have written programs in C++, Java, and PHP before, using Ruby will definitely make you feel you have accomplished more in less time. The only other language I have experienced of that's in the same league as Ruby's simplicity and elegance is Python.

Ruby on Rails is a complete framework

It is wise for an organization to standardize on a framework. Using different implementations for the same tasks is a maintenance nightmare. Even if the same programming language is used, varying the techniques in every project would not lend to code-reuse and knowledge sharing among developers.

Ruby on Rails is a well-thought web application framework. The APIs necessary to build web applications are already available and are well integrated with one another. Ruby on Rails already has code generation tools for automated builds, unit and integration tests. There are also a number of tools built around Ruby on Rails to handle, for example, deployment to a single or multiple servers and migration of databases.

Ruby on Rails has strong emphasis on coding convention over configuration; For example, class names, the corresponding file names, and their locations follow a convention; separation of concerns using the model-view-controller paradigm are strictly enforced. While you may view these constraints as disadvantageous, it is actually a good thing because it forces the developers to focus strictly on business features and not on the details of the programming tool.

The Ruby on Rails community

Ruby on Rails is just over a year old and relatively new compared to Java and PHP. However, the adoption rate of Ruby on Rails is very high and many of the best programmers of both the Java and PHP communities are rallying behind Ruby on Rails. Dave Thomas, one the leading figure of the Pragmatic Programmer fame has already co-written (with David Heinemeier Hansson) a book about Rails, which is one of the best-selling computer books in Amazon.com's history. Bruce Tate, who has written a number of best-selling Java books, is very candid about the weaknesses of frameworks based on Java (e.g. Struts) and is recommending Ruby on Rails. Other Java leaders are also adopting Rails like James Duncan Davidson and Stuart Halloway.

Ruby on Rails and Web 2.0

Ruby on Rails, as well as many frameworks, is independent of the visual design of a web application. However, based on applications launched in recent months, it is observable that Ruby on Rails programmers are also attune to Web 2.0 style of visual design. Ruby on Rails programmers are launching applications that are visually attractive and uses the latest Ajax approach to make web applications more interactive and responsive. The latest release of Ruby on Rails has built-in support for Ajax-based interface design that allows programmers to create interactive interfaces without the need to navigate around the complexity of Javascripts.

Maintainability and productivity are imporant

If you were given a choice to maintain between a 20,000 lines of Java code and a 800 lines of Ruby code, which would you choose? These numbers are based on the project by Rick Bradley whose team converted from Java to Ruby.

Maintenance cost is a function of size and quality of the code. Even expert Java programmers will not argue that programs written in Ruby is an order of magnitude smaller than Java. More importantly is the understandability of the code. Ruby is definitely easier to comprehend than Java.

One point used against Ruby and for defense of Java or PHP, is the few programmers who know Ruby. While this is true for now, this point is based on naive understanding of software development. Many organizations believe that if they used Ruby, it would be difficult for a Java developer to get up to speed. The truth is programming language plays only a small role. Knowledge of programming language alone cannot guarantee a quick understanding of the working environment and the business settings where the application is used.

Ruby is definitely simpler than Java or PHP. Anyone who has experience in any two programming languages will have no problem picking up Ruby on Rails.

Will Ruby on Rails replace Java?

It is natural for many programmers to have second thoughts on the merits of Ruby on Rails; some even dismissing it as simply a language for writing toy programs or throwaway prototypes. What is noteworthy is that veteran and novice programmers alike are rallying behind it and organizations are consistently publishing experiences proving their use of Ruby on Rails a very good decision.

When Java was introduced, naysayers said that Cobol will die. But it didn't happen. If someone tells you that Java will die, don't believe them. Java will never die. If someone tells you that Ruby on Rails will replace Java, don't believe them. But Java will lose (or is already losing) a significant share in the web application space.

Java will eventually slide to Cobol's and C++'s status. Not too long ago I use Yahoo and Alta Vista as my search engines. But now all people know about Yahoo is email and photos, and what the heck is Alta Vista? Is that a resort in Laguna? It's the nature of innovation. No technology will be on top of the curve forever. Sooner or later, it will slide and another will take over. For some, it will come as a surprise; for others it will be the classic, "I told you so".

public class HelloWorld {
  public static void main(String []args) {
    System.out.println('I am Java program');
  }
}
puts 'I am Ruby program'
Read more articles at the archives, click here.

Post Comment

All Comments: Latest 10

Posted by: munyot_at_yahoo_dot_com
Date and Time: 2006-07-20 01:44:03

Mr. bournerude,

Nobody told you to drop PHP, espeically if it's your bread and butter.
Back To Article

Posted by: bournerude_at_gmail_dot_com
Date and Time: 2006-07-17 21:31:01

been playing around with cakePHP for a couple of days and indeed it looks very promising.
bakit ko bibitawan and PHP if 100% of my projects are based on it? plus, im not at all that keen to learn another language and technology na hindi naman supported ng aking suki na webhost :P
Back To Article

Posted by: nimrod_dot_abing_at_gmail_dot_com
Date and Time: 2006-07-15 16:45:33

If you have a lot of PHP code (like me) that you don't want to throw away, but want to use a framework like RoR I suggest you look at the alternatives written in PHP:

http://www.h3rald.com/articles/view/rails-inspired-php-frameworks

By far, CakePHP seems to most "legacy-friendly" since it works under both PHP4 and PHP5. Which is why I've chosen it as the foundation for my new projects.

See: http://abing.gotdns.com/cake/diffs/changes.xml
And: http://abing.gotdns.com/2006/07/09/41/
Back To Article

Posted by: nimrod_dot_abing_at_gmail_dot_com
Date and Time: 2006-07-15 16:27:50

@greg

I have lost my profiling notes, but in case anyone else wants to do some profiling on RoR under Linux, I used Siege on the client machine and to monitor overall server performance, I installed the OProfile patches and tools for Linux.

One explanation as to why DJango outperforms RoR in the test below:

Python is able to "compile" scripts into bytecode form while Ruby is not able to do this. As I've pointed out earlier, Ruby is the bottle-neck here. Not RoR.
Back To Article

Posted by: nimrod_dot_abing_at_gmail_dot_com
Date and Time: 2006-07-15 16:13:03

@greg

I couldn't find my profiling notes, must have gotten lost when I upgraded my virtual machine setup. But here's one better:

http://wiki.rubyonrails.com/rails/pages/Framework Performance

This is even better than my setup which was done using a virtual machine (VMWare) since it uses a real server.

I used a similar setup for testing RoR on the virtual server though. I must admit that my setup was less than ideal since both the test platform and the virtual server are the same machine.
Back To Article

Posted by: nimrod_dot_abing_at_gmail_dot_com
Date and Time: 2006-07-15 15:49:20

@lmiranda:

I'm already working on a print button which will spit out an XHTML document suitable for print. It will be up once I sort out this new authentication system I'm working on for this site.
Back To Article

Posted by: lmiranda_at_gmail_dot_com
Date and Time: 2006-07-13 22:35:56

sir napansin ko lang, i print ko kse sana etong article na eto. kaso nung nasa print preview nako sa firefox. walang laman, empty ung page.?
Back To Article

Posted by: greg_dot_moreno_at_gmail_dot_com
Date and Time: 2006-06-30 01:13:04

Hi Nimrod, ping us when you publish your experience report. That way, we can all learn from you.

I've observed (not from a quantitative study) that RoR is slower than PHP. But, as they say, hardware is cheap and it can easily be addressed unlike productivity and maintenance which costs a lot more than hardware.
Back To Article

Posted by: nimrod_dot_abing_at_gmail_dot_com
Date and Time: 2006-06-29 14:46:06

Before anyone misinterprets what I have said below, let me re-iterate that I *have* tried RoR and even with FCGID, response times are still slow. Mind you, I did this on a fully instrumented setup and I found the cause of the slowdown to be Ruby itself.

Also the fact that it has to be installed from source on the server hosting PW is a put off for me. Anyway, I've kept a log of my attempts. Maybe I'll post it on my blog.
Back To Article

Posted by: greg_dot_moreno_at_gmail_dot_com
Date and Time: 2006-06-28 05:44:15

The online community is http://groups.google.com/group/ruby-phil.
Back To Article

Posted by: munyot_at_yahoo_dot_com
Date and Time: 2006-06-27 03:23:18

ano ka mo rllq_ at_rl lq_do t_com? Have you tried looking at RoR? Looking at your post tells me you don't know what you are talkin' 'bout!
Back To Article

Posted by: rllq_at_rllq_dot_com
Date and Time: 2006-06-27 01:46:01

i agree with nimrod. i would rather use pear framework or create my own classes than to use ruby.

but if it's for rapid web application development, maybe I can consider ruby or macromedia dreamweaver's built-in oop support for php/mysql.

too bad dreamwever doesnt support postgresql...
Back To Article

Posted by: jiggsfoo_at_gmail_dot_com
Date and Time: 2006-06-25 22:06:25

nice article!

You mentioned that there is a growing community of RoR users in the country. Do they have a list or a website?

I sure would like to be part of that!
Back To Article

Posted by: nimrod_dot_abing_at_gmail_dot_com
Date and Time: 2006-06-24 09:48:47

When PW V3 was being developed I actually considered Rails (still in beta). I got around to installing and running it under Ubuntu. I wasn't impressed with its performance though. Even with fcgi enabled *Ruby* was still a lot slower than PHP.

Another problem I saw was that Ruby had to be installed on the production server from source. Not a problem really, but packages from built from source are a pain to upgrade.

Eventually I settled on a framework I had written two years earlier.
Back To Article

Posted by: izetart_at_gmail_dot_com
Date and Time: 2006-06-22 06:55:17

berger
Back To Article
Latest Articles
 

File:Expat
By Bel Ragay

A 23 year old girl who works as a designer in a foreign country (with foreign people, foreign languages, and foreign food) li... read more

 

Lucida Hybrid: The 'Grande' Alternative
By Jose III Olarte

Lucida Grande is such a nice font to use in websites, but because it doesn't come standard with Windows, we turn to Lucida Sa... read more

 

The Big Switch: A Touch of Windows
By Luis Buenaventura

From a web designer's point of view, the one thing missing in a Mac environment is Internet Explorer. Yes, the browser everyo... read more

 

The Big Switch: Designer Tips and Tricks
By Luis Buenaventura

When people say that MacOS is a very designer-friendly environment, they don't just mean that because of the elegant use of c... read more

 

The Big Switch
By Luis Buenaventura

A Mini-series on Switching From Windows to MacOS. I've had my Macbook Pro for or almost two weeks now and I think I've had en... read more

Read more articles at the archives, click here.
Ralph Lauren Quintano
Lizbeth Buenaflor
Erwin Lazaro
Edwin Otico
Carlo Angelo Isles
Darell Gensaya
Lai Reyes
Miguel Francisco
Derick Tadeo
Jeffrey Faurillo
Secretary / Receptionist
Jr. Web And Graphics Des
Web Development Team Lea
Flash Developer
Digital/ Graphic/ Fine A
Graphic Designer/ Art Di
Web Designer
Urgent - Senior Web Deve
Webdesigner
Web Designer
drop down menu problem (2)
bloggers (2)
How much will you charge (9)
Exploring Design: Outsta (1)
help pls.. (5)
domain registration (1)
i-codesign.com -- domain (1)
Cyber Development Group (1)
Halloo!! (3)
Graphic Resume or Profes (1)
 If you're not a PW member but would like to participate, click here
Frequently Asked Questions
Internship Opportunities
Meet the Moderators
Advertising
Partner Websites
Link Us
Why Marvinsweb
Terms of Use