3 ms·
I have updated the title to add the year [2007]. I am not a Rails programmer but as far as I know it is fair to compare PHP to Rails. Please down vote if you
by niyazpk 17y ago
I have updated the title to add the year [2007].
I am not a Rails programmer but as far as I know it is fair to compare PHP to Rails.
Please down vote if you think article is not relevant.
- jacquesm 17y agoI think that comparing PHP to rails is not the best way to get an idea of where both stand. Ruby, the language and PHP the language vs rails on one side and CakePHP or codeigniter would be more appropriate. I understand that since most people that use Ruby are also rails users and since most people using PHP hack their own little framework.
- simonw 17y agoPHP is a "framework" in the sense that it provides the core mechanisms for doing webby things - accessing query string and POST variables, sending HTTP headers, reading cookies, mapping URLs to executable code. I actually think comparing stand-alone PHP to frameworks like Rails or Django is reasonable, since they all solve the same problem. Of course, such a comparison should also take the existence of higher level PHP libraries and frameworks in to account - it would be silly to criticise PHP for not shipping with an ORM, for example.
- jacquesm 17y agoThey are things that apache sets up for mod_php, php the language is a standalone thing that you can bind in to apache like that. I know that PHP was pretty much born for the one purpose of making webpages but you have to try to see the one separate from the other. php-cli works fine.
- peterhi 17y agoTo some degree it is relevant (it's not about fixing the transmission of a Ford Cortina) just not very relevant given the changes both languages have undergone in the intervening times. If you are a PHP programmer how would you view an article about someone who started to use Drupal found that they didn't like some aspects of it and switched to programming in Java. You would probably think that giving up on PHP because of a framework when there are plenty of others to choose from was pretty short sighted and was representing PHP unfairly. This is why comparing Rails, which is a framework, to PHP, which is a programming language, feels wrong. Rails is not the only framework, it just feels like it :D
- Zak 17y agoI'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.