Ruby on Rails v PHP

Having come across lots of lively discussion about the pros and cons of Ruby on Rails and PHP Frameworks, I thought I’d post my tuppence-worth!

Not to be confused with the Ruby language it’s in, Ruby on Rails is an equally popular web framework. So holding a Ruby on Rails vs PHP contest may seem like comparing chalk and cheese.

My personal opinion, as a developer is that I prefer Ruby on Rails. I have used PHP for over 15 years and Ruby on Rails for over 7 years. And I do almost all my new development in Ruby on Rails. There are several reasons for this:

  • Rails is really the only “go to” framework for Ruby so I don’t have to choose between a multitude of competing frameworks.
  • Rails was a pioneer in the progression of MVC architecture and it does it very well.
  • PHP seems like old technology now, consequently there is a lot of old, bad PHP code out there – including some of mine from years ago, oh dear, did I really write that?!
  • Ruby really is a step up to a higher lever in terms of coding, away from C-like syntax to more intuitive, readable code.
  • When I switched to Ruby on Rails I found I had more time to focus on making a usable application rather than worrying about lower level functions because Rails provided so much out of the box.

PHP is still very widely used (e.g. this site uses WordPress of course) and there are a few areas where it beats Ruby on Rails:

  • Speed is the most obvious difference. PHP is faster. However, when you’re using a framework (e.g. like Rails on Ruby and Laravel on PHP) the difference isn’t so noticeable.
  • PHP has a vast choice of frameworks and this may be exactly what you want.
  • PHP is more popular (source RedMonk).
  • PHP has come on leaps and bounds since I switched to Ruby on Rails 7 years ago. Laravel is an excellent, popular framework, and PHP now has its own dependency manager called Composer.

So the choice is yours. As with all decisions, do your research.

Leave a Reply

Your email address will not be published. Required fields are marked *