Go Premium for a chance to win a PS4. Enter to Win


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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
This article discusses four methods for overlaying images in a container on a web page
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

879 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