PHP or Ruby on Rails – Which One To Pick Your Next Web Product?
Tags: ruby, rails, php, webdev
Published: 2019-07-16 08:26:16

A venerable veteran or a prodigy? PHP or Ruby on Rails – which one to pick for a web development? Answer is not that obvious. 

When it comes to internet development there were two technologies that had transferred static webpages done in sturdy HTML into the interactive multimedia tech of today. First one is JavaScript, enabling the user to polish a frontend of the solution. The second one is the PHP, that stands somewhere in between the frontend and the backend, standing behind the power of most popular solutions including WordPress and Magento. 

But is one of the most renowned technologies still relevant in 2019? Can it stand comparison with modern languages and frameworks like Ruby on Rails?

What is Ruby on Rails
Ruby on Rails is a framework for Ruby language designed to make coding easier, faster and more convenient for web developers. The technology imposes numerous good practices including DRY (Don’t Repeat Yourself) that encourages developers to reuse blocks of code. 

Also, the tool follows the Convention over Configuration path, enabling developers to minimize the configuration work by proposing a predefined environment. 

Ruby on Rails is one of the most popular technologies in the world, powering [over 824 thousands of websites](https://trends.builtwith.com/websitelist/Ruby-on-Rails) out there. It was included on the list of 20 most popular technologies in the world delivered by [TIOBE Index](https://www.tiobe.com/tiobe-index) and ranked 13th on [StackOverflow’s ranking of the most popular programming languages](https://insights.stackoverflow.com/survey/2018#technology).  And there are many [awesome websites using this technology](https://ideamotive.co/blog/40-best-ruby-on-rails-companies-websites).

What is PHP
PHP is a script language designed to deliver websites and web apps in real time. It is one of the most renowned technologies in the web, used by [79% of all websites existing](https://w3techs.com/technologies/details/pl-php/all/all). PHP powers up popular open source solutions with WordPress and Magento being among the most popular ones. Facebook was initially delivered in PHP and later on translated to C++. 

Fun fact about PHP is that every year commentator and experts debate on if the language is dead or is going to be dead soon. But this time PHP has a lot of in common with Mark Twain, as the report on its death is an exaggeration. 

Why should we compare them?
In fact, comparing PHP with Ruby on Rails is not that fair. PHP is a programming language, while Ruby on Rails is a framework. So it would be much fairer to compare RoR with some PHP framework, be that Zend or Symfony2. 

But not really when it comes to PHP programming. Most developers prefer to cherry-pick own set of libraries and plugins to leverage in their project, effectively creating own framework. Due to PHP legacy, most popular frameworks are making coding more complicated, not less as in case of Ruby on Rails web development framework. So in fact building, a comparison done on framework vs. framework basis would be inherently flawed. 

So how those technologies perform when compared?


Ruby on Rails vs PHP – User Interface
PHP has a strong background as a tool to connect websites with databases. It was not designed to make the webpage shine, but to enable the user to access a vast array of content. It works well when it comes to that, but to deliver an astonishing user experience it needs to be supported with additional technologies like JavaScript. 

Ruby on Rails is known for delivering shining and polished websites that enhance the user experience. It is a modern technology, born after the UX principles and fully backing building the user-centric websites. 

Verdict: Ruby on Rails outruns PHP. Double time. 

Ruby on Rails vs PHP – Architecture
Ruby on Rails is praised for adopting the Model-View-Controller paradigm, effectively forcing the user to follow the best practices on building apps. Thus, when the user properly, the framework comes with well-performing and stable architecture. 

PHP, as mentioned above, is usually used saute, with every developer building own stack of technologies. it gives freedom – including the freedom to deliver messy code and unstable architecture. The quality depends only on the skills of the developer. 

Verdict: So again, Ruby on Rails vastly outperforms PHP. 

Ruby on Rails vs PHP – Speed of coding
With DRY principle and Convention over configuration forced, Ruby on Rails web development enables developers to do what is best at – coding. It cuts off a lot of time usually wasted for mundane work of configuration and delivering a programming environment. 

PHP again usually comes to saute, with no tools to speed up configuration or any other aspect. So the language, despite being relatively easy, can provide a headache during the implementation of the end solution. 

Verdict: sorry, PHP. Not this time

Ruby on Rails vs PHP – Performance
Ruby on Rails is fast and elegant. It delivers good-performing code backed by good programming practices and reliable architecture. 

PHP is a programming language, so it is hard to determine if its performance is better than RoR. With full freedom to deliver marvelous (or crappy) code. 

But assuming that there are only development stars on board, PHP outperforms Ruby on Rails. But to be honest – are there? It is not that easy to find a star, no matter if you are looking for Ruby on Rails web developer or PHP coder. 

Verdict: PHP. But only when done well

Ruby on Rails vs PHP – Community & support
PHP is renowned, venerable, rustproof and unsinkable. Considering that, there is a strong demand for PHP coders. Also, with PHP being around since 1995 there is a gargantuan library of tricks, Q&As, and already solved problems. Moreover, there are numerous PHP developers on GitHub or Stack Overflow to help both on the language itself and particular technologies like WordPress or Magento. 

Ruby on Rails is much younger technology, yet already mature, with a thriving community. But there is no way to outrun the experiences gained since 1995. 

Verdict: PHP, Sometimes nothing beats experience. And that’s the case.

Ruby on Rails vs PHP – Stability
With MVC and DRY paradigms forced, Ruby on Rails delivers little to no issues with stability.  By reusing blocks of code, developers ensure there are no hidden dependencies or hardcoded info that should have been inserted as a variable. 

With PHP there is total freedom. It means bot freedom to create or to destroy. With no imposed rules but the programmer skills, the stability heavily depends on the coder’s skills. That can mean anything – from total unbreakability to a minefield. 

Verdict: RoR delivers some level of stability for granted. PHP is ranged from “unbreakable” to “snowflake”. When approaching an unknown land, Ruby on Rails seems to be a better pick. 

Ruby on Rails vs PHP – Documentation
Ruby on Rails comes with clear, legible and logical documentation, that supports Ruby on Rails programmers on every aspect of their job. 

PHP on contrast comes with documentation designed in 1995, the pre-good-practices era. Sometimes riddled or inconsistent, usually omitted due to extensive help available in the Internet.  

Verdict: Ruby comes with better documentation. PHP lacks one, but does it really matter this time?

Ruby on Rails vs PHP – The maturity of the platform
Ruby on Rails is one of these technologies that are mature enough to get rid of  teething problems yet modern enough to be compatible with the newest trends. 

And when talking about PHP – is that an issue? Really?

Verdict: PHP. Maybe Fortran is more mature out there. 


Summary:
When to use PHP?
PHP is currently the most popular web language. Its popularity comes from a vast amount of open source software using it. So if the problem is totally standard with no perspectives to be tweaked in any way, PHP can be a good choice. A totally standard blog can be run on WordPress with no doubt in the same manner as e-commerce can be supported by Magento. 

But [if you look for something more sophisticated](https://ideamotive.co/blog/ruby-rails-ecommerce-product), the tech from previous millennium can be a risky choice.  

When to use Ruby on Rails?
[Ruby on Rails development](https://ideamotive.co/services/ruby-on-rails-development) is a mature and stable technology to support more sophisticated solutions. Moreover, as a web-centric framework, RoR enables companies not only to digitize but to augment business processes with new possibilities. When the company needs something more than “standard” or “typical” solution, Ruby on Rails is a better pick, especially when you need some [sophisticated e-commerce product or SaaS product](https://ideamotive.co/blog/ruby-on-rails-saas-product). 

To be honest – would you like your company to be “typical” and “standard” one?

Originally published at https://ideamotive.co/blog/php-vs-ruby-on-rails