PHP vs Ruby – which developers are more in demand?

By George Fironov ·Subscribe

Have you heard the legend of Ruby-istan, PHP-istan, and Arrogant-Programmer-istan?

One of the most interesting and honest places on the internet is Reddit. While browsing threads to find material for this article, I stumbled upon an interesting legend. 

Legends are rarely the stuff of articles about software development, but this one very elegantly sums up the problem of Ruby vs PHP.

Allow me to give you the short version of the legend. (or you can read it in full right here, but come back to this article right after!)

There were 3 kingdoms. In PHP-istan, warriors would first learn to fight without any weapons. Then they were given a choice between 3 main weapons – the Dreaded Drupal, Elegant Laravel, and Mighty Symfony.

Then there was Ruby-istan. Here, a lot of warriors never learned to fight without weapons. Most started their training by learning to wield their one main weapon – the Powerful Rail.

The last kingdom, Arrogant-Programmer-istan, was observing the development of both kingdoms as they were nearing a state of war. 

Spies informed the leaders of Arrogant-Programmer-istan of what was going on, and they hold council to decide what to do in light of the upcoming conflict. 

Despite there being 3 different, but equally powerful armies in PHP-istan, the council disregarded that. They focused on the fact that some warriors in PHP-istan never learn to wield a weapon, so all warriors must be unprepared for real battle. Especially when compared to the glorious Ruby-istan warriors with their shining, Powerful Rail. 

Ultimately, this was what led to their demise. PHP-istan warriors powered through Ruby-istan, and eventually reached the borders of Arrogant-Programmer-istan to conquer it.

 

Ruby vs PHP vs popular opinion

The legend is universal, and apparently it constantly repeats itself in real life with slightly different scenarios. 

It alludes to the fact that there is a popular opinion that PHP is a “silly” language. There are plenty of examples of this.

Like this developer meme – a dev job ad for the pornographic site Pornhub, where a developer commented “I don’t want my friends and family to be ashamed of me. If I get the job, will people know I use PHP?”.

You know, because using PHP is more shameful than working for a porn site. (cue the laughter!)

Opinions are like DNA sequences – everybody has one, and they are often so deeply built into our mind that they’re virtually unchangeable. 

If several high-profile IT experts repeat something, like a negative comment towards PHP, that opinion spreads and becomes popular throughout the programming community–regardless of whether it’s actually true, or only applicable in one specific situation.

All this goes to say that popular opinion doesn’t really matter. And sometimes it can be damaging when people pay more attention to opinion than facts.

Like when one developer became the laughing stock of a hackathon simply because he opted for a tech stack that included PHP, whereas most other developers there went for JavaScript.

So instead of opinions, let’s look at the facts.

 

PHP:

 

It’s focused on server-side scripting, but it can do much more than that. With the extension of previously mentioned Drupal, Laravel or Symfony, it can be used to build powerful web applications.

Probably the biggest reason why people smirk at PHP is that the basic use of PHP is as an extension of HTML. By comparison, JavaScript started out with a similar purpose, but there’s a key difference:

JavaScript code is executed in the user’s browser, whereas PHP code is executed on the server, and generates HTML that is then sent to the user’s browser. 

This way, with PHP the user doesn’t see the underlying code–just the resulting page element. Actually, all HTML files can be processed with PHP, and then users wouldn’t be able to see any of the code that runs your website or web application.

Another reason why it’s laughed at is that it’s simple to learn. But most things that are simple to learn are hard to master. Mastering PHP opens up a whole new world of possibilities for software developers, because it offers a smorgasbord of advanced features.

All in all it is a stable, seasoned, tried & tested & perfected technology that can be used in various situations.

 

Ruby:

 

Similarly to PHP, Ruby is described as a scripting language that can be used for various purposes. It, too, isn’t too complicated to learn, and holds powerful features in store for those who take time to master it.

First developed in the 90s, it only really started gaining popularity after the creation of Ruby on Rails around 2005. To this day it is still the most popular Ruby framework. It helped a lot of developers make the switch to Ruby, as well as enabled Ruby programmers to build powerful web applications more easily, and much faster.

Ruby is built with Object-Oriented programming in mind, whereas PHP support both Functional and Object-Oriented approaches.

It is a clean, easy-to-read language that can be applied to much more than just web scripting.

Okay, so these things might matter to programmers. 

What are the real differences between PHP vs Ruby from a project manager’s perspective?

 

The real differences in technology and demand

Are Ruby programmers more expensive than PHP? Well, sort of.

It depends where you look. Payscale.com says that PHP developers earn between $44.000 and $93.000 per year, whereas Ruby developers earn between $50.000 and $122.000. 

But then Glassdoor.com says that PHP developers earn between $77.000 and $122.000, whereas Ruby developers between $62.000 and $94.000.

Which site is right?

Payscale’s estimate seems more realistic, especially when you look at Stack Overflow’s 2019 Developer Survey. Under most popular programming languages among professional developers, the survey shows that PHP is much more popular.

The TIOBE index (which ranks programming languages by popularity) supports this, with PHP on the 8th position on the list, and Ruby on the 11th.

Simple demand-supply reasoning tells us that if there are more PHP developers, then a Ruby developer with the same amount of experience and similar skills will probably be more expensive.

However, I’ve mentioned it in other articles, and I’ll probably keep mentioning it: what’s good for the project manager is what’s good for the project.

If your codebase is in Ruby (for valid technical reasons), and you need more developers, then market demand doesn’t matter. You just do all you can to find the right Ruby developer.

Same with PHP, and same with any other technology. From an ongoing-project perspective, what matters is that you find the right people to finish before the deadline. If you’re already building in one technology, switching to another might be too much trouble (it’s doable, but you need a big budget and the rarest commodity of all – time).

From a planning perspective, however, choosing the right technology from the start is a crucial decision. Choosing the right tech stack matters the most before starting the project.

That’s when you should consider not only technological limitations, but operational aspects. For example – how easy will it be to add more developers to the team if necessary?

If this matters in your project, and it can be built with either PHP and Ruby without quality loss, then choosing PHP will be a better business decision, as it will be easier to find new devs when the need arises.

But if it doesn’t matter, you have all the time in the world to finish your project, and there are technical advantages to using Ruby – it will be the better choice.

These are the things you should consider when planning your project.

 

Summary

PHP is just as good as any technology–up to the point where it isn’t a viable choice for your project. That’s why it’s important to make the right technological choices while planning.

Ruby is less popular than PHP, but it doesn’t make it better or worse. It’s just the way that the market is shaped.

All in all, popular opinions about tech, or market demand for different types of programmers don’t matter much. 

What always matters the most is what’s good for your project.