Ruby vs. PHP (Part 1)

I’m a proud PHP user. I won’t lie – I’ve never really considered Ruby as a replacement for PHP (until now). I’ve started to do research and I’m starting to come to the conclusion that Ruby may be a better choice than PHP, or at least a good skill to have.

Ruby vs. PHP (Part 1)

Money matters

This one is pretty straight forward – would you make more coding PHP or Ruby? There are a few factors that could determine the answer to our question.

Freelance or salary job

There is a large difference between freelancing and working a salary job. First, let’s talk about freelancing.

From my point of view, it’s much easier to find freelance jobs when coding PHP. At the moment, I only see around 25 Ruby jobs on getafreelancer.com. Only around 5 actually seem to involve Ruby. For the rest, it just seems like someone threw on the extra tag because they were unsure if a coder could use Ruby. On the other hand, there’s around 1000 PHP jobs on getafreelancer.

It could be debated that although there are many PHP jobs, the competition for those jobs is much more intense, even to the point where you wouldn’t be able to get any jobs. I don’t think so. I’m pretty sure that from 1000 jobs you could land at least one.

PHP might be the winner when it comes to freelancing, but Ruby owns PHP when it comes to salary jobs. Let’s compare a few graphs from PayScale:

Ruby Programmer

The average salary for a Ruby Programmer is around $75,000.
The average salary for a Ruby programmer seems to be around $80,000. This is just an estimate. This graph isn’t exact, as you can probably tell. Ruby hasn’t been around for 10-19 years, so no one can have 10-19 years of experience with it.

PHP Programmer

The average salary for a PHP programmer is around $50,000.
The average salary for a PHP programmer seems to be around $60,000. This is just an estimate. This graph isn’t exact, as you can probably tell. Ruby hasn’t been around for 10-19 years, so no one can have 10-19 years of experience with it.

As you can see, Ruby is the winner here. These stats may not be completely accurate, but the general trend is that Ruby jobs pay more than PHP.

Ease of use


I can’t really write about this at the moment. I haven’t used Ruby, so I can’t compare.

I’m pretty sure that I’m going to try Ruby soon. More specifically, I might go for Ruby in Rails. I hear that it’s pretty similar to CakePHP, a framework that I use with PHP.

I didn’t plan on making this a mini-series, but I guess that it’s hard to avoid that now. I’ll be comparing the languages in my next post, and then probably comparing frameworks. Stay tuned so that you don’t miss either of these posts! Thanks for reading!

What do you think?

Which do you prefer: PHP or Ruby? Do you have any experience that can prove or disprove my theory that Ruby pays more than PHP? Please leave a comment!

Like this post? You can find many more like it by subscribing to my feed.

12 Responses

  1. If you are really PHP developer you will get a fine salary. Tell why Oracle and IBM stick with PHP not RUBY. Sorry for my bad language but, ruby is rubbish :) .

  2. Sorry Heiken, I don’t actually agree with you about IBM and Oracle. I am working with Oracle for more then 5 years now and using both PHP and Ruby. What I can say is that PHP yes, it was first involved in Oracle support then Ruby, but at the moment of writing, Ruby support in Oracle libs are far better and more stable then those on PHP. About the salary you are right, if you are a good PHP developer, you can get a even higher salary then $75.000. About Ruby, I am working on it for 1.5 years in large projects (more then 100.000 lines of code) also working on the same size projects in PHP and I can say that writing PHP code is NOT so great when writing Ruby is a pleasure. The era or structured code has gone (yes PHP has some ‘baby’ style of OOP, but I laugh when I read about it in a book or a forum), now is the era of OOP (Ruby is 100% OOP based language, it is elegant, easier to maintain, better to extend and a pleasure to work with). I am working with PHP since version 3 and all their improvements over the major versions was just adding some support of OOP and additional extensions and security improvements, but PHP remains to be the structured language even with its ‘baby’ OOP additions.

  3. @daniel, Heiken, and Vitaly

    Thanks for the comments!

    I agree that Ruby is easier to maintain. PHP’s OOP implementation is basically to give programmers the option to use it, while Ruby’s is the essence of the language. So Ruby is obviously stronger when it comes to OOP. OOP is necessary when managing very large projects (in many cases), so we can come to the conclusion that Ruby works better for large projects, as Vitaly suggests. As all assumptions like this, this doesn’t apply to every situation.

  4. Correct me if I am wrong but I think this is the correct one

    PHP – large projects
    Ruby on Rails – Larger progjects

    PHP is good too in large projects as long as you make and build good foundation in your codes ^^

  5. Hi Kyle,

    Thanks for your comment! I wouldn’t say that you could generalize and say that. It all depends on the specifics of the projects and the people working on the projects.

  6. Language wars, To be perfectly honest, are pointless. If you can write your applications to be extensible, maintainable, and decent speed that won’t drive away users from your product, then it does not matter what language you use. We need to stop thinking of ourselves as php developers or ruby developers or even python developers.

    We need to see these languages as tools on our tool belt and use them where we see fit. Stop hiding under a language security blanket because you have used X language for Z years and are comfortable with it or because you don’t feel like traveling outside your comfort zone out of laziness. Lets be developers and not language fanboys ;)

  7. @sdwrage

    I agree. When I post about PHP and Ruby in the future (hopefully I will soon), I’m going to focus on the two languages as different tools that have different applications. There’s really no point in trying to see which one is better since they are two different tools that are both on our side.

    Thanks for your comment!

  8. I am a .NET developer and I am making about $85k + bonuses. So, I would say that .NET developer would end up making a lot more than Ruby or PHP guys.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>