Ruby on Rails vs. PHP: It’s Time to Set the Record Straight
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.
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 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 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 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 repetitions.
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 a 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 plenthora 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.
More information can be found in the full article.
gasp... bah... To be honest biggest problem for me and why I would not go ROR is because there are no developers in western Europe doing that language. So I would depend on outsourcing to Ukraine or Russia if I want to continue working with ROR, thats the biggest down side. As a technology it most likely is as good as PHP or other languages. So for that reason only, Im out! (shark tank quote).