PHP vs Rails
Ranked #232 in Internet, #9,739 overall | Donates to Squidoo Charity Fund
I Confess, I'm In Love With PHP
PHP vs Rails
I know it's not fair, but neither is life. PHP is a language and Rails is a framework. How can one go about comparing them?
The fact that it isn't an apples to apples comparison doesn't stop people (including myself) from throwing them into the ring for a deathmatch.
Although I spend a significant portion of my day talking to Rails developers, I still prefer PHP. In fact, this site is built on it. I understand the Rails philosophy of helping developers write good code by forcing them to use a structured framework, but the more advanced an application becomes the more difficult it becomes to work within that structured framework.
In addition, Rails performance is a major issue. Many people argue that development is faster with Rails, a factor which offsets the additional hardware costs, but this still has yet to be proven. I will definitely agree that prototyping is faster in Rails, but extending an existing Rails application (to replace the framework's default feature set) becomes more cumbersome as the application grows larger.
Points of View
- PHP vs. Rails - concrete examples
- From the Joel on Software Discussion Group
- Clickable Bliss Blog ยป PHP vs Ruby on Rails, Part 1
- Musings from an independent developer, Cocoa, Rails, and UI for the most part.
- Rails vs. PHP: MVC or view-centric
- David Megginson's weblog about technology, especially XML and web architecture.
- Why PHP vs Rails?
- An unbiased analysis
- PHP vs Ruby - Practical Language Differences
- Another unbiased analysis
On Frameworks
The problem is that it's possible to outgrow a framework. If you become too comfortable in the framework itself, you'll either not understand how to extend it, or struggle with resistance to change.
Let me give you an example. Rails prides itself on being "database agnostic," meaning you can take the same application and run it on Oracle, MySQL, SQL Server, etc. By the same token, that also means you aren't able to take advantage of some of the benefits of each of those databases. It's like designing a web site only in images because browsers don't always support the same HTML and Javascript sytnax. Most projects never require a database platform migration, and extending Rails to support platform-specific features requires extra effort.
But that's just one example. PHP offers many Rails-like frameworks such as Zend Framework and CakePHP which quite possibly suffer from the same affliction. I'm not suggesting that frameworks are bad, merely that one should be mindful of the tradeoffs in using one.
What Do You Think?
Fight It Out
PHP is better than Rails
Fetching blurbs now... please stand byYes, PHP is better!
whoisbid says:
php has to be better simply because I have no idea about rails which means for the moment I need to investigate but in the meantime php stands out much more
Posted September 03, 2011
computer_repair says:
PHP is better, because the client doesn't require a "PHP Framework." Have you seen the size of the .NET framework for Windows?
Posted August 28, 2011
alokagga says:
Benefits of using PHP as development language http://www.akritisoftwares.com/PHP-Development-Company.aspx . Its far better then rails
Posted August 26, 2011
boomajoom says:
PHP is easier to learn, in my opinion, and frameworks like CakePHP give you a rails-like environment for deploying sites quickly.
Posted July 03, 2011
webcodez says:
I really LOVE PHP personally. I've been using it for like 6-7 years now and I'm still loving it. So I go with PHP!
Posted June 12, 2011
PHPProfessor says:
You did a great job of describing why someone would shy away from Rails!
Posted February 24, 2011
beingasha says:
One will find more jobs, more web hosting providers and more clients using it, so I will go with PHP. However Ruby on Rails is also emerging.
Posted February 09, 2011
dskanth says:
I prefer PHP over Rails, as php is very flexible than Rails, and i can use cake php over Rails. Also, as the owner said, as the application grows, PHP (or its framework) can better handle the situation than Rails. So php is the winner for me.
Posted December 03, 2010
StephenC says:
I've only worked with php, so I can only say that which is better. I have never heard of rails, actually, and certainly will be doing further research.
Posted October 08, 2010
garyr_h says:
I'm more of a PHP guy, although Rails is definitely up and coming. I've been doing PHP for about 6 years.
Posted March 12, 2010
ZipOnOver says:
The higher the level the quicker they fall, Rails guy may not comprehend this statement. PHP will be here tomorrow Rails maybe not!
Posted January 12, 2010
dannystaple says:
While rails has come across as embodying some really cool concepts, I have never actually seen a project (other than tutorials) through with Rails. Once you start pulling apart the scaffolding, it starts to get much harder. It is like a game with a nice intro level and a really punishing next level - it gets put aside. PHP is familiar, simple. It is not really "better" just it will get used more often in the toolbox, and "better the devil you know".
Also there is the hosting. Nearly every bargain hosting can give you PHP on Mysql, but Rails is harder to find.
Posted December 24, 2008
4x4ever says:
Comment #2 (first one was in the Ruby section): I dunno if PHP is better - never used it but I have been learning Drupal (in my spare time, since early Feb) and I can put up a pretty full-featured and nice looking web-site in no-time. You may check fxsoftwaresolutions.com - my first Drupal web-site, not too much content yet but you can see the functionality. Drupal is based on PHP and did do some PHP coding for this site. I come from a C++/Java background and PHP strikes a cord with me as it resembles these languages (syntax-wise).
Posted April 27, 2008
No chance. Rails is amazing!
arthurccube says:
Rails is for people who understand the structure and concept.
Php allows developers to do ad hoc codes.
If you don't even understand what is 'Don't repeat yourself' and follows it correctly, how can you use Rails?
Most developers tried to use Rails but think in PHP, it must failed.
But PHP allows you to code in PHP but think in Rails, since there can be no structure and concept or algorithm at all.
Php is easy to code and code it wrong.
Rails is not easy to code and not easy to be wrong.
Posted February 01, 2010
THAiSi says:
The think that strikes me most is that a lot of people started using PHP for web-development, haven't really worked with rails (on multiple types of projects) and shout PHP is better. I've used PHP for 6 years full-time, and Rails now for 1.5 year full-time. I'm educated in computer science, and learned Object Oriented programming there. I know a lot of programmers who are self-thought, and don't understand Object Oriented programming. These people will never understand rails, its structure and cant see past the 'magic' and understand how and why it works in the way it does.
I love Rails for the fast prototyping, and there is a big world behind it's magic that, thanks to the language Ruby, makes it great to customize it totally for your own needs using meta-programming and other tricks that PHP could never have.
For everybody that is educated enough to try Rails, do that first for a certain amount of time and then draw your conclusions.
Everybody that has used only one of the two finds their own technology superior, because that's the only side they know.
Posted April 08, 2009
4x4ever says:
Actually, Seth, PHP is a completely legal drug :) ... as in, yes, it is addictive. I like it quite a bit and so I really shouldn't be posting on this side but since I want to "pun" Seth and since the Rail guys seem to be at disadvantage, plus, as chaostheory pointed out one shouldn't comment unless one has experience with both (and I don't) - I think it's ok if I post here. Then I'll try posting on the left side and if squidoo allows me will file one more bug report for Seth's collection :P
Posted April 27, 2008
Paul says:
Wordpress is an excellent example of where PHP goes wrong. Customizing Wordpress has been a pain in the ass -- and my server uses Postgres, so I have to work off somebody's bastardized fork of the code.
If Wordpress were written in Rails, it would just work with both databases, and there would be a much clearer customization mechanism that didn't require so much forking.
(Incidentally, the article is wrong: you can ABSOLUTELY use DB-specific queries and features. You just don't HAVE to all the time!)
True, there are DB-agnostic frameworks out there for PHP, but if I'm investing in a framework, I'd rather make it one that uses a great language. PHP appeals only out of familiarity bias. As a language, it's a nasty mishmash of ideas with no central strength. Its OO is a hoax. Ruby's Smalltalk heritage gives it a kind of depth and consistency that PHP just doesn't have.
Posted February 28, 2008
Codey says:
Ruby's syntax keeps me with Rails. There are many virtual machines in development that should solve the speed issues that are currently holding back many Ruby projects. I'm vehemently opposed to semicolons.
Posted February 14, 2008
Robert Dempsey says:
I developed in PHP for many years before moving to Rails. While I prefer Rails (and have a Rails shop and a not-for-profit educating people about Rails), the choice of language (or framework) is both a matter of what works best for the problem you are trying to solve as well as preference. If we can step off of the playground for a moment then I think we can agree to disagree.
Posted February 12, 2008
theben says:
As someone who's done extensive work in both (including a little PHP you may not know you've used :), I'm firmly in the Rails camp. Before I was able to use Rails full-time, I ported concepts from it into my PHP. I'm both happier and more productive using it. It's no contest for me.
That said, every technology has its sweet spot. If you're stuck on crappy shared hosting and don't mind the inconsistent interfaces, tacked-on "OO," and all-around ooginess of PHP, go for it.
Posted February 11, 2008
Winfred says:
If you prefer PHP then Ruby has an equivalent (but superior) technology. It's called erb. If you already know php, you can just write erb templates that look just like PHP file. Plus you get an actual object oriented language in case you want to use objects.
Rails goes far beyond just erb and gives you a full MVC framework to help organize your code -- if you don't know the benefit of this then keep using PHP, you won't ever outgrow it.
It takes about 3 hours to learn more than enough Ruby to do pretty much anything you would want to do with Rails... so give it a shot!
Posted February 11, 2008
chaostheory says:
Unless you've done a good amount work using BOTH Rails and PHP - your comments are near worthless, aside from continuing a religious flame war. Even then, different people do the same things differently; so naturally they'll be more efficient with different tools...
This is a waste of time. IMHO you should either be building something or help someone else building something - instead of dissing someone else's work that they're sharing with everyone for free.
Posted February 11, 2008
Nirav Sheth says:
Rails is better for building new web apps from scratch vs. PHP for building upon existing web apps. If you do it right, you can get much better results for Rails based applications than PHP ones. And its done in smaller amounts of code!
Posted February 11, 2008
PHP Lovers: Post Your Blog Posts and Supporting Links Here
Premium Wordpress Themes
Best Premium Themes for your blog from premiumthem more...2 points
Rails Lovers: Post Your Blog Posts and Supporting Links Here
Rails Envy: Ruby on Rails vs. PHP - Ruby on Rails Commercial #6
During the last round of videos, we got quite a fe more...1 point
Slow Down
Don't take this lens too seriously. Of course PHP vs Rails isn't a fair comparison, and I left out many of the reasons why Rails can be a better choice for your project. This lens is just a thought exercise and a way for you to express your opinion and feel better about your platform of choice.
by giltotherescue
Gil Hildebrand, Jr. is an experienced software developer based in New York City. He is currently the Chief Engineer of Squidoo, and has been doing cra... more »
- 8 featured lenses
- Winner of 13 trophies!
- Top lens » PHP vs Rails
Explore related pages
- Learn PHP PDF Guides - Learn PHP in 24 Hours Learn PHP PDF Guides - Learn PHP in 24 Hours
- How to Become a Freelance Software Developer How to Become a Freelance Software Developer
- Live Update javascript: tips and tricks for web designers Live Update javascript: tips and tricks for web designers
- CakePHP Framework Tutorial CakePHP Framework Tutorial
- A Ruby Reader A Ruby Reader
- Web Development Tips & Tricks Web Development Tips & Tricks
