Ruby on Rails ORM wannabes never quite cut it do they?

Every now and then I see an article about an alternative implementation of some aspect of Ruby on Rails in another language. The latest is about Propel, an ORM layer in PHP. Let's compare and contrast:
$dish=new Dish();
$dish->setName("Beans on Toast);
Ruby on Rails:
dish=Dish.create(:name=>"Beans on Toast",

$c = new Criteria();
$c->add(AuthorPeer::FIRST_NAME, "Leo");
$results = AuthorPeer::doSelect($c);
foreach($results as $author) {
print "Author: " . $author->getLastName() . ",
" . $author->getFirstName() . "\n";

Ruby on Rails:
Author.find_by_first_name("Leo").each do |author|
puts "Author: " + author.lastname +"," + author.firstname

In the last example, Ruby on Rails would of course delegate the outputting of author details to a view - I put the "puts...." line in to illustrate how much more intuitive the ActiveRecord syntax is. No disrespect to Propel - it is clearly a major piece of work, has features that are not present in ActiveRecord and could make a huge difference to those obliged to code in PHP. But I know which I'd rather be using! The problem is that PHP is just plain ugly compared to Ruby. I used to use PHP, but I can't really understand why so many people are still using it. Inertia I guess. Tell me if I'm wrong!


Popular posts from this blog

ActiVote Walkthrough Part 1

Someone is looking for the Catburgers!

The actor's life for me