• Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 560 other followers




PHP vs. Ruby

Below is a great answer to my PHP vs. Ruby question from Geo.  Just had to share!

I asked:

Are PHP and Ruby developers ever the same animal?
Most of my clients are developing massive scale eCommerce or communication networks and only want PHP.
Where does Ruby come in – for lighter weight, rapid web development?
Does a PHP developer have deeper – or just different – coding ability?

Geo answered:


There are actually 3 points here.

  • Ruby
  • Rails
  • PHP

The issue that happens with rails is that most people introduced to Ruby have been introduced via Rails.
Rails is a framework that utilizes Ruby as language of implementation.

Now Ruby vs PHP. Not that one is better than the other, but PHP has a much more extensive library of extensions and modules, and it’s object oriented model has been implemented over time. Ruby on the other hand has been designed from the ground up as an object oriented language, and definitely has a very modern well thought out syntax. Ruby’s community and as well as libraries are growing, but it is no where near the number of PHP’s. As a language Ruby is slower than PHP, but this is a bottleneck that can be worked around. The real issue is with Rails and its tightly coupled architecture.

Rails, like I said is a framework – a contract on how an applications architecture’s base will be implemented. 9 times out of 10 Rubiest think framework first ( Rails ) vs Language first; THEY WERE INTRODUCED TO RUBY VIA RAILS. 9.9 times out of 10 perl,php, and python people think language first. The success of Rails has brought about an implementation of it MVC structure to perl, php, and python which has enabled perl,php, and python use to ADOPT BEST PRACTICES via Frameworks like symfony,zend,cakephp, django, joomla framework ( not the cms ). Now because Rails is such a “turn keyish” type of framework, issues start to occur when sites start to grow, and what happens is that because so much was done for you at the framework level, meaning “Oh, look in Rails you don’t have to worry about X, it is handled automatically”, that when issues start to occur you are not familiar thoroughly with the architecture ( internals of RAILS) that is becomes extra work to handle high loads. Some, bottle necks in Rails are, ( RAILS FANBOYS, notice how I said SOME):

  • Application startup and bootstrapping
  • Active record and database implementation layer
  • Caching without having the application bootstrap

These issues are also in CakePHP which is the closest implementation of Rails in PHP, they even copied the mistakes! Symfony, Zend, and Joomla Framework are much more loosely coupled, with Zend coming out as the loosest. To deal with very high traffic, TWITTER had to start scrapping away RAILS in certain parts and start developing with scala and even c++. Many Rails fanboys started crying when this happened.

In all, there are very competent Ruby programmers out there that aren’t tied to Rails, but nowhere near the amount of PHP.


9 Responses

  1. “In all, there are very competent Ruby programmers out there that aren’t tied to Rails, but nowhere near the amount of PHP.”

    May be you should spend some time on Joomla/Drupal/Wordpress forums/mailing lists/IRC. The amount of ignorance prevailing there is astronomical.

    As for Twitter scaling issue, it’s been answered umpteen times. Even Twitter engineers have admitted that its nothing to do with Rails.

    PS: I’m a Python programmer.

  2. All this nonsense about the “epic fight” between ruby and php (sometimes also childishly rails vs php, which still doesn’t make any sense and still amazes me).
    There’s no such thing as PHP developer or Ruby developer… there’s a thing called Beginner developer and expert developer through Senior developer…
    The only thing I can agree on is that There’s definitely more Beginners in PHP, therefore by being maybe 60% of the “php developers” then people think that we all are incompetent slobs…
    but think about it closely… if there’s 1000 php programmers and 600 of these code with their feet, 400 are experts and up… 40%
    if there’s 10 ruby programmers, and 3 of these are beginners and still code with their feet , 7 are experts up… 70%

    I think the numbers are pretty close to this.

  3. What are the tradeoffs (e.g. development speed, performance, scalability) between using various php frameworks, ruby/rails, or python/django?  Is there any reason to choose one overwhelmingly over another?…

    If you are looking out of the box performance and scalability then probably Python is a better choice than PHP, as far as I read. Yes, I know, Facebook was built in PHP and is scalable…but they customized a lot of the PHP, so much that it doesn’t re…

  4. I guess it seems more like a matter of preference (or necessity) really depending on the type of project you’re trying to tackle.

    I’ve started a “learning” project and did a friend a favor by offering to rebuild an ancient website he has into the modern times. I’m torn between feedback from my developer friends, with half saying PHP is the way to go while the other half says Ruby should be the choice (I only have 2 developer friends). I clearly fall in the “Beginner” category, but I am serious about eventually mastering one of these two languages. The project I’m going to tackle involves some lightweight database activities, which is why my Ruby friend says I should join his camp. Though IMO as long as the coding is elegant then language choice probably isn’t an issue? I’m leaning towards PHP because of its broader developer base and libraries, though I want to make sure my feet gets off the ground at the right direction given the amount of time I’m willing to invest in learning one of these two babies.

    Any thoughts or advice?

  5. Ok this is interesting, cuz I’m a web beginner I wanna start developing an idea but i want it to be best as possible from the beginning.

    So about learning RoR or CakePHP what do you think wich is better?

    Community, RoR vs PHP which has more development? I understand that ruby community could help RoR to get better but RoR could be take as something apart like PHP (CakePHP is a framework and you have what cake offers and thats it, and you can use vendors or plugins development)

    What other aspect should i take into account in order to use one or another framework?

  6. good point!

  7. To those who want to learn how to program and are wondering, PHP or RUBY?

    You’re looking at it the wrong way… you learn to program. Once you know how to program, the language being used becomes insignificant.

  8. Agreed Bradley. Pick one. Learn it. Master it. once you’ve done that then the other one will come easy. The cool thing about most languages is, once you understand structures, it’s twice as easy to learn new languages.

    By the way, I prefer PHP (most of the time) as long as you plan ahead abit it’s easily scalable.

    I’d also like to add that I code with my brain but I type with my feet.

  9. Helps to listen to you guys. Different opinions or not.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: