Rails vs Laravel
Ruby on Rails is currently my preference for an MVC framework. In my experience as a programmer, Rails developers are some of the most skilled and most passionate web developers in today’s industry. Like many Rubyists, I can’t quite put my finger on all of the reasons why Rails wins for me.
I, like many Ruby converts, started in PHP. Before starting at Whiteboard, I had barely heard of Ruby on Rails; in school, I was primarily taught PHP.
After starting at Whiteboard, Rails has permeated conversations around the office for the better part of a year and half, and in that year and half I have grown to love it. The separation of concerns Rails offers through basic MVC is a breath of fresh air for me.
Despite these personal affinities, I think Laravel will gain and eventually eclipse the popularity of Rails.
The Scope of the Debate
This debate is over the popularity of Rails versus the popularity of Laravel. Not Rails vs. PHP.
Ruby (and, for web, Rails) solved the issues of overreach that have caused nightmares for PHP developers. PHP’s lack of strict purpose has lead it to become a cluttered, discombobulated collection of mismatched tools that few can wield properly.
Ruby on Rails was released in 2005 and was the first largely successful MVC web framework (post-dating Spring, a relatively lesser-known Java MVC framework). PHP didn’t have a popular MVC framework until 6 years later in 2011, when the first commit was made to the Laravel source code by Taylor Otwell.
The sheer number of PHP developers is massive, likely due to the fact that LAMP stacks are easily accessible and cheap, and much easier to get running than an average Rails server (though solutions like Heroku challenge that assumption). What’s more, the rate of new projects using Ruby has been on a relatively sharp decline over the past couple of years. PHP, on the other hand, is on the rise. While Ruby (and, arguably by proxy, Rails) is still winning out, PHP isn’t leaving the scene any time soon.
I believe that the powerful concepts introduced by Rails that are carried on by Laravel will propel it as a more popular MVC framework for web, above Rails, in the coming years.
Changes in PHP
The final area to focus on is that of the PHP language. Despite PHP’s history of sloppy structures and strange tools (like the highly web-specific nl2br function), PHP is changing constantly. Great new features like PDO change the fundamental nature of PHP, and even though some of those old oddities still remain in the language, powerful, clean code is now accomplishable with PHP. For example, PHP has also introduced real classes, offering true object oriented constructors. This specifically makes Laravel a natural match for the language, as it relies heavily on object orientation. Of course, by preferring object orientation over unorganized declarative-style programming, PHP developers also benefit from much more concise and maintainable source code then the stringy mess of yesterday’s PHP projects.
I haven’t jumped ship from Rails for Laravel… yet. But I do have an intense curiosity with the future development of Laravel. If Laravel can accomplish the community-driven culture and craft-consciousness of the Ruby community, it has the opportunity to naturally not only surpass Rails, but to become one of the web’s the most valuable and widely-used MVC frameworks.