[Webinar] Streamline your web hosting managementRegister Today


Why has Ruby On Rails gained so much ground over PHP?

Posted on 2012-03-20
Medium Priority
Last Modified: 2012-03-21
A year or two ago I remember PHP a language everyone wanted to learn and now that I'm looking around again at web languages it appears like Ruby On Rails is the hip new thing.

What does Ruby On Rails have that has caused everyone to flock over to the new technology. I thought PHP has MVC frameworks. Am I missing something?
Question by:Eindoofus
  • 2
LVL 24

Assisted Solution

johanntagle earned 500 total points
ID: 37747021
Obviously you will get subjective answers to such a question.  Besides enabling rapid development, I think it's because the Rails framework espouses popular methodologies like Agile, iterative and test driven development.  If you follow Rails development best practices, you already practice these methodologies.  Another would be convention over configuration - Rails has predefined conventions where to put most of your code - so you can concentrate on developing functionality vs spending time thinking how to lay out your code.  

And oh, Rails was already hip as early as 4 years ago =)
LVL 111

Accepted Solution

Ray Paseur earned 1000 total points
ID: 37747143
No, you're not missing anything.  PHP has MVC frameworks.  ROR is (much, much) more object-oriented and is, to put it bluntly, a more professional development tool.  

PHP was designed to be the easiest language to use, and as a result it has a lot (millions) of adherents who have no clue about the principles of computer science.  You can learn a little and build a web site that will "do something."  But as Alexander Pope noted, a little learning is a dangerous thing, and these novice sites will often have security holes, or will be unable to scale, or will produce incorrect output.

ROR was designed to be the best language for prototyping.  A consequence of this design is that you need to sit down and study ROR before you can start using it.  By favoring convention over configuration, it means that you have to learn and use the conventions.  To the individual who knows nothing of computer science, that is a daunting learning curve and PHP may appear to be the easier path to some kind of functionality.  

The ROR conventions are fairly well thought out; almost any site can be prototyped successfully.  But some of the early catastrophes suffered by Twitter can be laid at the feet of Ruby on Rails.  It's only a one-size-fits-all solution up to a certain scale.  Then you need bespoke programming when you want to go big.  In contrast, PHP is used for all of Digg, much of Google and Yahoo, all of Facebook, etc.

And as johanntagle correctly notes, PHP has been around for a long time (I built my first PHP web site with PHP3 in 1999), whereas ROR is a product of the new millennnium.  That alone would argue for a surge in its popularity.  An older programming language, COBOL, rose to great popularity in the latter quarter of the 20th century.  It rose to great popularity largely because it was supposed to be "self-documenting" since the variable names could be long enough to spell out human words.  Each age has its values.
LVL 20

Assisted Solution

virmaior earned 500 total points
ID: 37747346
Both johanntagle and Ray note some things that are true about the rise of RoR and the weaknesses of PHP.

One thing that is worth mentioning is that the RoR prototyping does tend to scale better when written correctly but again this is because RoR makes you write better code whereas PHP merely allows you to write good code (and permits you to write junk).

A further factor to consider is that RoR is trendier than PHP right now ... but don't be fooled by trends. My father is 70 and was a COBOL programmer earlier in life. He last did COBOL programming in 2009 -- and the going rate is great because there are still tons of systems out there and non-COBOL programmers don't generally know how to do it.

I don't think PHP will disappear any time soon and as Ray points out it has some big systems using it too. It's weakness is that if I hear someone writes in PHP, I don't know whether they are a script kiddie or someone with a good grasp of the theory. When I hear someone programs in RoR, I know that the code they produce is going to be easy to work on (in general).
LVL 111

Assisted Solution

by:Ray Paseur
Ray Paseur earned 1000 total points
ID: 37747519
permits you to write junk
;-)  No kidding!

In general, for all the reasons virmaior notes, ROR programmers get paid more than PHP programmers.  That may produce an incentive for multilingual programmers to recommend ROR over PHP - it automatically moves a programmer into a more prestigious zone.

The only thing I might add to this discussion before I sign off is that ROR has not really "gained ground" on PHP in absolute terms.  It had a faster rate of adoption and growth in recent years.  This page is informative about the trends.  See especially the "Hall of Fame" part for an historical perspective.

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question