Back in 2005 I read The European Revenge. It was published in 1973. It was written by two journalists from the Economist magazine. They made the daring, controversial argument that at some point in the near future, European car makers such as BMW and Mercedes would be able to make cars that had just as much quality as American cars.
Their daring idea is something for my generation to laugh over. I came of age in an era when it was simply assumed that European cars were naturally better than American cars. Over the course of 30 years, the reputations of the various car makers had reversed positions.
Tonight, I find myself thinking daring, controversial thoughts about Ruby On Rails and PHP.
I recall in late 2005 when I first started hearing about Ruby On Rails. It was an amazing system for building big web sites much faster than anything before had allowed. I watched the video that showed how you could build a weblog system in 15 minutes. The company I worked at then hired a consultant who was also a very great programmer, a fellow who, by coincidence, had been writing about Ruby since 1999, well before most American programmers had heard of the language.
At that time, it seemed like Ruby On Rails was going to sweep all before it. PHP seemed like a dinosaur, headed for extinction. Software written in PHP was notoriously sloppy and insecure, and the programmers who worked with PHP tended to be less experienced than the programmers in almost any other programming community.
I started to study Ruby On Rails on the assumption that all PHP work would eventually disappear, and if I wanted to have a job in 2008, I’d better get with the new, new thing.
But, of course, Ruby On Rails failed to sweep all before it. It had a big impact on programming in general and on web development in particular. But of all the programming communities, Java was probably more profoundly effected than PHP. For Java programmers, Ruby On Rails lead to a re-thinking of fundamental assumptions.
When Ruby On Rails first came out, PHP was not competitive. There were no high productivity frameworks for PHP. But that has changed. PHP now has Cake, CodeIgniter, Symfony, and many other frameworks. These are all full-featured MVC frameworks, with command line scaffolding tools that automate the construction of basic CRUD forms and basic layout templates, and which therefore offer some of the same productivity gains that Ruby On Rails offers.
So much contempt has been poured in the direction of PHP that it seems normal to think it must be inferior to every other programming language. But it is worth remembering that some very good programmers have never liked Ruby:
I classify myself as one of those developers who don’t get Ruby, just like I don’t get Perl. Both are too hard for me. And there seems to be something in my brain that prevents me from learning both. It’s strange I never had the problem with C or C++ or Python or Lisp or awk.
…I just don’t like Ruby. This has more to do with how I think and work than with the true quality of the Ruby language. I’m sure Ruby is a fine programming language offering good OO features. But there is something in it that rubs me the wrong way. I tried to learn it when the first edition of the PickAx book came out. But somehow I can’t get past the “we are so OO, we write 3.abs instead of abs(3)” noise. I’m sorry. It’s not for me. There. I said it.
Most programmers first heard of the Ruby language when they heard about Ruby On Rails, so the language and the framework have always come in a bundle. If we unpack that bundle, do we find that some portion of it is stronger than the other portion? Since some good programmers dislike Ruby, yet the whole programming world has fallen in love with high-productivity frameworks like Rails, isn’t it safe to assume that Rails, the framework, is what made Ruby On Rails so awesome? That the awesomeness is clearly not tied to the language is demonstrated by the vast number of frameworks that have now been implemented in other languages. Most of these framework imitate aspects of Rails. If the awesomeness of Ruby On Rails was due to the Ruby language, then surely more programmers would be learning Ruby, rather than trying to imitate Rails in whatever language they know best. Many of these new frameworks have become successful in their own right, and have kept programmers in one language who might have otherwise converted to Ruby. Certainly, back in 2005, it seemed like there was likely to be a mass conversion of Java programmers to Ruby On Rails. That mass conversion was forestalled by the emergence of frameworks like Grails, written in a language derived from Java.
If the language Ruby doesn’t explain the awesomeness of Ruby On Rails, then that awesomeness can be captured by other languages, including PHP. I’ve been working a lot lately with Symfony, and I am impressed with the tools this framework makes available to me. Although all of the PHP frameworks had a late start, relative to Ruby On Rails, the PHP community now has a much greater diversity of frameworks to choose from, and the competition between the various PHP frameworks is likely to cause all of them to improve at a rapid rate, and also to specialize toward particular niches.
Where does that trend get us in another 3 years? Just as Mercedes went from being an inferior car to being a superior one, it seems to me that we could end up in a situation where the PHP frameworks are actually better than Ruby On Rails for any particular purpose that you can imagine.