3 ms·
I've worked with PHP in the past, and occasionally still do when the situation demands it. I've also built web apps using Ruby, with Rails and without a framewo
by Zak 17y ago
I've worked with PHP in the past, and occasionally still do when the situation demands it. I've also built web apps using Ruby, with Rails and without a framework. All of the following are possible options for building a website:
* Bare PHP
* Bare Ruby (but you probably should not use mod_ruby)
* PHP and a framework
* Rails and a framework
From a pure language perspective, I'm willing to declare Ruby superior without hesitation. It's cleaner, and it's more powerful. Ruby seems to have had a fairly clear vision from the beginning, while PHP has accumulated features over the years, sometimes without regard to how well those features might work together.
If you just need to get something done, you should use what you're familiar and comfortable with. No advantage of any of these options is as important as the programmer's ability to use the tool.
Frameworks are opinionated. The purpose of a framework is to take away the work of making certain kinds of decisions. If your opinions clash with those of the framework, the project isn't going to go well. Rails is of the opinion that the database should have a certain sort of schema, and be abstracted away by ORM. If you like SQL, don't use Rails. If you have a complex existing database, and you want to keep it instead of moving the data to a Rails-friendly schema, don't use Rails.
The article doesn't really serve as a comparison of PHP and Rails. It's just a story about what happens when a tool is a poor fit for a project.