Switching from Rails back to PHP?
Posted by Jon Lee in Ruby on Rails, Web Development, tags: PHP, Ruby on Rails, web development
This post is a response to Derek Siver’s post on the O’Reilly blog. Over two years ago, he decided to ditch a hundred thousand lines of messy PHP code in favor of rewriting his whole site with Ruby on Rails. Two years later, he isn’t even half done and has decided to go back to PHP. Just two months with PHP again and the project is complete.
He gives seven reasons of why he switched back to PHP after 2 years of unsuccessfully. I agree with some but not others. Here are his 7 reasons, you can read them in more detail on the original post.
- “Is there anything Rails/Ruby can do that PHP can’t do? … (thinking)… NO.â€?
- Our entire company’s stuff was in PHP: Don’t underestimate integration.
- Don’t want what I don’t need.
- It’s small and fast.
- It’s built to my tastes.
- I love SQL.
- Programming languages are like girlfriends: The new one is better because *YOU* are better.
Comparing Apples and Oranges
First of all, I would like to present the analogy of building a tree house. You can either build a tree house with precut pieces of wood and material (Ruby on Rails) or you can build a tree house by chopping down your own trees and making your own pieces (PHP).
Building a typical tree house is very easy with precut pieces. It is then just a matter of putting things together in the right order. However, if you wanted to deviate from a regular tree house and put in, say, an electric elevator, then you would have to find someone that has built something similar and copy it or modify your existing material to do so.
Building a tree house from chopping down your own trees is more time consuming but you have full control every step of the way. If you want a circular piece of wood, then you create a circular piece of wood. You still have some pre-built materials given to you like nails and screws (built-in PHP functionality) but all the custom stuff needs to be created.
Ruby on Rails is a framework. It streamlines the process building a web application or website. You can do many things with it but some may require little hacks and workarounds. If one wishes to compare Rails and PHP, it would make more sense to compare Rails with a PHP framework such as Zend or CakePHP.
What I Do Agree With
Although I think the comparison is a poor one, Derek does raise some very good points. First, I do find that sometimes it is easier to comply with what is already in place instead of trying to overhaul an entire system. I’ve worked at places where the entire system backend was built on layers and layers of poorly documented UNIX scripts. It would take an enormous amount of time to go through and figure out exactly how everything fit together in order to recreate the whole system in a more structured manner. Throughout the way, dependency problems will undoubtedly arise and everyone that has already gotten used to the old system will have to be retrained (which is no easy task).
Second, no matter how you look at it, a properly written PHP application will be faster than a Rails application. One of the drawbacks with Rails is that it is said to be hard to scale. There are solutions but for the same amount of computing power, PHP applications are typically more efficient since it leaves off a lot of extra unused fluff that is present in frameworks.
Anybody out there move back to PHP after trying Rails? I know I did for a while since I had a tight deadline on one project and couldn’t learn all the insides and outs of Rails in time.
Popularity: 3% [?]
Entries (RSS)