-
Thoughts on Migrating from PHP to Ruby on Rails
Posted on December 15th, 2008 Comments
We had been dedicated to PHP-based Web development using our very own development framework for more than half a decade; we implemented our framework in PHP and had a great deal of success in building countless products and services for small businesses around the world. Many years ago, I choose LAMP (Linux/Apache/MySQL/PHP) as the development infrastructure for the company. LAMP has done good for us. .However, like any other technologists, we had been keeping our eyes and ears open on whats he Web development trends. For the last few years we started noticing more and more excitements with the Ruby on Rails platform. But we had been reluctant to jump on the Ruby on Rail bandwagon too quickly because of some concerns regarding performance. In the recent months, we had revisited the Ruby on Rails platform and found that the performance concerns were no longer legitimate to put down the gem — Ruby on Rails (RoR).
Here, I want to share why we decided to start the migration to Ruby on Rails (RoR) platform for EVOKNOW. If you are pressed for time, you can consider reading the following lists that we have created on www.ListBorg.com:
Why Good Programmers Like Ruby
The official Ruby site’s logo shown above says it all — Ruby is a programmer’s best friend. Because, unlike other languages, Ruby was written to be programmer friendly, which meant that it cares more about the programmer who is writing the code than the compiler. This initially worried me because, I can name another language that became super-hit because it was programmer friendly — Visual Basic (VB). Microsoft VB was so programmer friendly that many people who should never be a programmer was labeled as programmers and learned their living as such for decade. So I have some reservations about languages that try to be programmer friendly. Why? Because, programmer-friendly languages try to oversimplify things and often make the life of the compiler hard, which in turns make the code sloppy and that in turns makes lousy software.
But Ruby (RB) ain’t VB! If you must know what Ruby does for a programmer to be friendly, check out the list below:
Why Ruby on Rails (RoR) is a Programmer’s Best FriendLet Rails Lead You to Better Web Development
Unlike PHP which has a zillion commercial and Open Source frameworks, the Ruby programming language has a de facto Web development framework — Rails. Rails, unlike other programming frameworks, wishes to remain lightweight and beautiful. This means, it is not getting bloated with new features.My short review of Ruby on Rails (RoR) led me to believe that the Rails framework is truly designed for programmer happiness. Then I wondered what is the benefit of programmer happiness other than what is obvious. Well, if you think of it for a minute you will come to realize that a happy programmer is a motivated programmer which is truly the silver bullet of productivity. You can have motivated group happily writing code because they are not burdened by the chores of repeating the same again and again. By using a great degree of conventions, you relieve the programmers from the configuration chores. For example, Rails use naming conventions to connect a class to a database table. A class called Transaction can work with a database table called transactions via the ActiveRecords design pattern implemented in RoR. By reducing code clutter, RoR makes programming fun again.

Going Beyond Web Development…
Since Ruby is a full-blown, well thought out language, it really has no Web-specific legs. Only when you use Rails with Ruby, you get the advantages of having a Web-centric framework. However, this means that Ruby itself is available for other development needs. For example, you can use Ruby to develop GUI applications in the massively deployed Windows platform. Ruby as a language does not constrain you to a specific operating system or environment such as Web or X Windows or Microsoft Windows. Surely, you can write PHP applications for these platforms using some tweaks but PHP was not really meant for these other environments and Ruby was not meant for any specific environment.
My Personal Interest in Ruby
Even though I officially left my coding hat in the late 90s. I still love to tinker with code and feel comfortable when I know the language considerably better. When I explored Ruby, I saw the Perl likeness of Ruby and found it comforting. There are many language constructs that are very close to what Perl does to reduce clutter. In case of Perl, they were often regarded as undesirables. For example:
puts "foo" unless barputs me at ease as that’s the Perl way.How Are We Getting Started?
When people find out that we are switching to Ruby, they ask what are you doing with it? Well, initially we are starting out developing some tools for ourselves. For example:
- We recently built an email campaign system using Ruby on Rails
- We are building an e-commerce suite in Ruby on Rails based on the SPREE e-commerce engine
- We are building a catalog publisher in Ruby on Rails that publishes catalog on WordPress via XML/RPC
Challenges Ahead…
When switching to a new development environment, it is always not quite a sweet transition. We have created the following ListBorg.com list that highlights some of the challenges we have identified so far: Top Challenges for Switching to Ruby on Rails (RoR) from PHP for PHP Programmers.
blog comments powered by Disqus
Site last updated January 19, 2010 @ 8:52 pm; This content last updated July 19, 2009 @ 8:55 am