So, you need to find web developers for the back end of your project. If you have no references to app development companies to contact them directly, what will you do? Most likely that Google will become the initial source of information for you. And why not? This smart guy knows everything.

Fine. You google something like “web development companies”, choose candidates, contact them and begin to discuss your project. In the process, you will definitely find out some technical details including the languages developers use to code for back end. Each team will give you reasons for using this or that language, which is quite obvious. Of course, you will try to find more information yourself to consider some unbiased opinions - and here comes Google again. It can provide various search results but the problem is that most of them will be for developers. This is great if you are tech-savvy and understand what that all is written about. But what if you are a non-tech person and everything you read goes in one ear and out the other?

It will definitely make you sad, but your disappointment will not change the situation. In this case, you just need to consult people who can interpret all that technical stuff into normal language. In this article, we will make such an interpretation for those who choose between Ruby on Rails and PHP as a back-end solution. This is very topical because there are a lot of people in both fan groups. They still debate on it, and the answer seems to be impossible to find. But we will try to do that.

What is PHP?

PHP is a programming language that is used to work on the server-side (back end) of an app. It was created in 1994 by a Greenlandic programmer Rasmus Lerdorf. It wasn’t done on purpose as he never intended to develop something big and world-famous. Lerdorf just wrote a set of scripts for personal use. It was aimed at monitoring the number of visits to his online CV. For performing this function, the scripts got the name “Personal Home Page Tools” abbreviated as PHP Tools. The improved version of this set was released to the open source containing a broader range of features. This meant that the code could be used and fixed by other developers.

PHP Logo
PHP Logo

This fact caused a chain reaction and PHP Tools started to develop into a programming language all in all. Rasmus Lerdorf was the author of the first two versions of PHP. All the following versions of PHP starting from 1997 were released by a development team under the guidance of Andi Gutmans and Zeev Suraski. As a true inventor, Lerdorf never abandoned his “child” and always participated in the development of PHP. He still continues to contribute to it.

What is Ruby on Rails?

As you can see, this phrase consists of two main words, Ruby and Rails. To fully understand it as a whole unit we need to clarify what each of its constituents is.

Ruby

Ruby is a programming language designed by a Japanese computer scientist and programmer Yukihiro Matsumoto, also known as Matz, in 1995. The origin of its noble and precious name is quite interesting. There were two options to choose from, Coral and Ruby. The reason why Matsumoto preferred the latter was quite unusual, Ruby was his colleague’s birthstone.

Ruby Logo
Ruby Logo

Ruby is a programming language used for creating back-end solutions of apps. Matsuomo created it for developers to enjoy coding. Ruby focuses on people not machines because the former control the latter and nor vice versa. A programming language has to help software engineers be productive and enjoy what they are doing instead of only taking care of computers.

Rails

Rails (Ruby on Rails) is one of the best frameworks created with Ruby. It is used for developing back end of web applications. The framework was initially extracted from a web app Basecamp that still exists. Having achieved colossal success, it is a one and only product of the same-name company now. The author of Rails, David Heinemeier Hansson, introduced it in open source in 2004, but allowed others to commit to it only in 2005. In the same 2005, he was named Hacker of the Year by OSCON for creating Ruby on Rails. Being 11 years old, the framework is the most popular one among its Ruby brothers and sisters. It is constantly developing and is utilized now in version 5.0.

Ruby on Rails Logo
Ruby on Rails Logo

Ruby on Rails main aim is to provide developers with valuable programming conventions and benefits that allow them to make their code more concise, clean and clear, and to avoid repetition.

Time to Compare

Cognition comes through comparison. If we want to find out the truth, it will be the most effective and efficient way. We will compare Ruby on Rails and PHP according to a few important criteria that should always be taken into account.

  • Nature of the languages

There are two kinds of programming languages, compiled and interpreted. Compiled languages presuppose that any code written in them by the developer should be further processed into machine code to run commands. Interpreted languages are simpler in this regard. Everything that is coded with their help is directly used to perform commands.

From this point of view, both PHP and Ruby belong to the same group. They are interpreted languages, so technically there are no differences between them.

The above statement is fair for PHP and Ruby only. If we compare the former with Ruby on Rails, there are a lot of things to consider. In spite of the fact, that we try to put a programming language and a framework in one line, this comparison is not unreasonable.

  • Code quality

Like any other language, programming languages have their own syntax too. Ruby and PHP use different syntax which means that there are great differences in their code too. Ruby creators initially claimed that their aim was to make code human-friendly. It wasn’t then and isn’t now the priority of PHP. Instead, it is designed to maximally fast cover as many functions that are necessary for programming as possible. So, if a Ruby developer sees some code of another project for the first time it’s much easier and faster for them to understand it than for a PHP programmer to get on the inside of what's been coded by their colleague. Besides, PHP has a plethora of frameworks that are structurally different (e.g. Symphony 2 and YII). Thus, if a developer changes one framework to another, it takes time to master a new one, sometimes even too much of time.

Rails is dominating on the market of Ruby frameworks. This makes transferring from one project to another quite easy and painless for a programmer as everything is coded in a unified style.

Ruby on Rails is at the peak of its growth at the moment. It has everything that is needed to fast and well develop not only a server side but also a full-stack web project. This framework is reliable and stable. Its syntax is simple and quite intuitive because it resembles usual English. What requires two lines of code and a couple of minutes in Ruby on Rails needs much more code and time in PHP. And if a task is non-trivial, a PHP developer might even perform a research to find possible solutions.

  • Maintenance

Ruby on Rails is easier to maintain as you write less code in it than in PHP for the same function. Its community strives to use standard approaches for solving similar issues. One of the principles of Ruby on Rails philosophy is “Convention over configuration.” It says that a developer should not use custom solutions that are clear only to them. Instead, they should choose common approaches and technologies. The more of best practices a developer uses the better it is for an app and for them personally because it shows their own level of proficiency.

In spite of the existing PHP Standard Recommendations, the majority of PHP developers use a more personalized style for coding that also depends on the framework they use at the moment.

Though PHP frameworks support a greater part of modern programming patterns, not all adhere to them. Speaking about Rails, 95% of developers follow the same standards. Let’s take the active record pattern, for example. Ruby on Rails can implement it “out of the box” and easily use it thanks to the clear and well-done documentation. This solution is proved by the 10-year experience.

  • Support and Development

Rails is very easy to support as everything is unified and standardized there. If some issues arise all developers know where to find and how to solve them. This is the result of the Rails philosophy and main principles that are strictly adhered to by the whole community.

PHP doesn’t have documentation versioning. If a new release comes out there are no materials about the previous one left on the official website. This causes difficulties for programmers who still need to support applications written in older versions.

Ruby wasn’t so fast earlier as it is now because its creators were working on it on a voluntary basis not being paid for that. We all understand that people need to earn money to have a decent life so the team worked as fast as they could afford it. Everything changed when Heroku began to invest money in the development. This company initially supported only projects made with Ruby, so they were interested in its progress a lot. They hired Yukihiro “Matz” Matsumoto in 2011 as the Ruby Chief Architect and since then the language began to consistently(!) develop. Every next big release of it improves the speed of performance. Now the programming language can easily compete with its rivals, including PHP. Matz received wide acknowledgement for his work on Ruby, the GNU project, and other open-source software solutions and got Free Software Award in 2011.

The core team that works on PHP development belongs to one company and they are quite conservative regarding some external community-driven changes.

  • Time to deploy

Deployment is the process of tuning up a web application server by a developer. PHP has a lot of deployment environments that allow activating the server side quickly. The same is with Rails except for its significant advantage: its environments are more unified. There are special tools that are well-documented, all developers know about them and can easily learn how to utilize them.

  • Resources and community

PHP community though being very big for historical reasons is very split up between a great number of its frameworks . Ruby on Rails community has grown greatly over time and is still developing. This is the framework the majority of Ruby developers use, and they all work on it in coordination.

Let’s compare the numbers taken from GitHub.

PHP Statistics on GitHub
PHP Statistics on GitHub

Ruby Statistics on GitHub
Ruby Statistics on GitHub

Ruby on Rails Statistics on GitHub
Ruby on Rails Statistics on GitHub


While PHP and Ruby have almost the same record, Rails is too far ahead from them.

Rails and PHP are both well-documented. The former has a lot of resources with answers to any questions and development aspects.

  • Learning curve

Some time ago, it was generally accepted to think that the learning curve of Rails was steep and PHP was easier to master. Let’s see if it is still so.

Ruby itself is not so simple as PHP, in fact. For a programmer with a relevant educational degree it is a more convenient and practical tool that doesn’t cause great difficulties to master. But if a newcomer wants to learn Ruby not having basic knowledge about programming it becomes a great challenge.

PHP is really easy to learn. It’s enough only to master its syntax and the door to web app development is open. But the quality of such applications remains in question.

  • Availability of human resources

The market is overrun with PHP developers but sometimes it can be even more difficult to find a high-skilled PHP professional than a Ruby programmer. The problem lies in the learning curve. It is easy to start with PHP but only very few reach top ranks. In Rails things stand differently. It is harder to start but then developers improve their skills gradually and consistently.

PHP community is equally spread across the globe while Rails experts are more accumulated in the western part of the world.

Generally, it is always difficult to find really good and skilled programmers. Nevertheless, if you care about the quality of your web application, such a search is definitely worth giving a try.

All Over the Web

So, if to think superficially, it may seem that PHP is good, but if you try to dig deeper, this illusion will be shattered.

There is always a tendency for good things to become very popular. Let’s see if it’s true for Ruby on Rails.

Statistics says that as of the beginning of November 2016, there are 1,055,584 websites out of the total 363,397,297 written in Ruby on Rails. It makes only 0.3% which is not much, of course. This list includes Basecamp, Yellow Pages, GitHub, Shopify, Urban Dictionary, AirBnb, Bloomberg, Dribbble, Kickstarter, and so on. Twitter used Ruby on Rails too but only at its early stages.

PHP usage statistics looks more cheery. 11.7% of all active website on the Web use this scripting language. This percentage equals 41,672,384 positions on the same general list of sites. The prominent representatives are Facebook, Wikipedia, Yahoo, Mailchimp, Tumblr, Flickr, Wordpress.

Look at a more detailed data below.

Number of Ruby on Rails and PHP Websites on the Web
Number of Ruby on Rails and PHP Websites on the Web

As you can see, PHP still has the upper hand no matter what group we consider. Nevertheless, if we analyze the development trends of both sides, a very interesting tendency can be observed.

Ruby on Rails Usage Statistics
Ruby on Rails Usage Statistics

PHP Usage Statistics
PHP Usage Statistics

So, the development of PHP and Ruby on Rails over a year shows that the latter framework advances steadily and has better share now compared to the same period last year. Though PHP still has a lead, its positions are even a bit lower than those of November, 2015. Such results cannot be called growth.

Let’s consider the popularity of Ruby on Rails and PHP in different regions. Google Trends can help us with that. We will list only Top 3 countries not to overload you with data.

Ruby on Rails Trends on Google
Ruby on Rails Trends on Google

According to the map, Ruby on Rails is in greatest demand in China, the U.S. and India.

PHP Trends on Google
PHP Trends on Google

PHP is also popular in China, followed by Angola and Tunisia. Quite surprising, isn't it? By the way, the United States are not listed among the Top 25 countries interested in this programming language.

Compared to the regions where relevant search requests are popular there is also data that says about the countries with the greatest number of websites written with the help of both competitors.

Ruby on Rails Usage by Websites in the World
Ruby on Rails Usage by Websites in the World

PHP Usage by Websites in the World
PHP Usage by Websites in the World

As you can see, Ruby on Rails is mostly beloved in the United States while PHP is valued in Russia most of all.

It’s time to sum everything up. All the above data makes the impression of PHP beating Ruby on Rails in all aspects. The facts are really louder than any words, but there’s the catch you are probably don’t see.

All complicated things can be simply explained if you know the backgrounds and understand them well. PHP is still alive because most of the Internet server side was initially written in it. Someone has to keep everything updated to prevent the obsolescence of resources. It would be logical to rewrite them if it wasn’t so difficult to accomplish. Such actions require a lot of time and effort, which makes them quite impractical and wasteful.

ElePHPant or Rails Running Gemstone?

There should be only one star in the competition of Ruby on Rails vs. PHP. The choice has to be very conscious as any web application requires a well performing back end. Both of them are supported by arguments in their favor as well as discredited by some disadvantages.

Analyze the needs of your app, your expectations and the benefits you can receive. This will definitely help you choose between the progressive and fast-growing framework and the leading scripting language that is not promising any more. Sorry for the obvious hint but this is the honest truth.

So, will the gemstone beat the elephant?

Need back-end development for your project?

We have a big team of Ruby on Rails professionals who can deal with a great number of tasks and challenges. They know how to write good code. Contact us to discuss the details.

Get in touch