During his keynote on the International PHP Conference 2006 Bray performed a little comparison between Java, Ruby (mainly Rails) and PHP. While I first thought, this could only be some dumb marketing stuff, the presentation was actually really good. Tim first introduced his comparison basis (Scaling, Dev Tools, Dev Speed and Maintainability) and explained his views on the 4 topics and which keywords he considers under each of them. This introduction was really good and well-founded. After that, he showed and explained a diagram to make the actual comparison:
While I agree on his views on Scaling and Dev Tools, I want to criticize the the other 2 points:
Dev Speed:
Surely Ruby on Rails is a fantastic framework, which allows extremely rapid development of web applications. Pure PHP is definitly slower. But while Rails is a Framework for Ruby, he did not consider frameworks for PHP in his exploration. There are lots of frameworks for PHP out there, which can do a lot for you, to rapidly create PHP applications. I never used Cake, but it seems to be quite far grown as a Rails implementation in PHP. Beside that, you have a lot of libraries and frameworks in PHP which follow a different approach than Rails does, but can also speed up your development drastically. Zend Framework, PEAR and not at last our own enterprise component library eZ components, to just name a few.
I think PHP should (almost?) be on the same level with Ruby here.
Maintainability:
There is a huge crowd of crappy PHP applications out there, no doubt here. But anyway, it is quite possible to write well-designed and easily maintainable applications in PHP, too. The reason I think so, is widely covered in the section above. We also have the fitting frameworks and there if you stick to certain paradigms, you can also write well maintainable PHP applications. For the reason that PHP does not force anyone to do this, we might still be behind Rails, but not as much is shown in the chart.
I am of the opinion that PHP and Java are quite equal in this point and are not that far behind Ruby.
But anyway, those maybe just my personal views on the topic and maybe I'm just biased by 6 years of PHP experience. In fact the keynote was really good and I really enjoyed it. Thanks to Tim for being there!
An important thought that your ez-colleague Tobias Struckmeier pointed out: Tim actually compared *Rails* with PHP and Java. With Rails being a framework on top of a language, this is at the very least misleading...
Link to commentI think scaling's way off. Connection pooling in java application servers allow them to scale in ways that php and ruby can't. And database performance is a pretty big issue. I love PHP, but I also disagree with you on maintainability. The lack of good variable scoping and packages still make PHP far too prone to weird maintainability issues down the road.
Link to commentYou did not listen, he was comparing what is widely used. And in PHP there are tons of Frameworks but each with nearly unnoticeable usage.
Link to commentThere is an extra "Tim" in the link to the Wikipedia article about Bray.
Link to comment
I attended the MySQLUG-Hamburg meeting this Monday, where we had a session about Rails' ActiveRecord package. After the session, we got to talk a bit and comparing Rails (the framework) against PHP (the language) seemed to be a quite common theme. Apples and Oranges, I say.
If I had to write a web application from scratch in plain Ruby without a framework whatsoever, I'd have little to no advantage over PHP in terms of development speed. In fact, I'd even say because PHP is optimized for web apps and Ruby is more like general-purpose, PHP would win hands down.
So all these comparisons you find all over the web really say nothing at all. It becomes a lot more interesting when you start comparing actual frameworks in different languages. Let's say, Ruby vs. Symfony vs. Struts vs. ASP.NET?
But wait, that would make no sense as well: You would need to compare only frameworks that follow the same design approach. Rails is classic MVC, so it wouldn't make any sense to make a direct comparison between Rails and ASP.NET, as the latter is an event-based component framework. ASP.NET could, for example, be compared to PHP's PRADO. But where to draw the line?
Well, no matter what comparisons actually would make sense - comparing frameworks to languages definitely doesn't :-)
I agree with you. I'm working with CakePHP a lot and besides other then the fact that PHP code won't quite ever reach the beauty of it's Ruby equilivant, there is little reason to put Rails that far above (Cake)PHP.
I think he just shouldn't have compared two languages two one framework, it's nothing that can objectively be done.
Oh, I actually did not get that part. Thanks for correcting me, Marcus.
Anyway, I think since the majority of PHP users seem to be unexperienced developers, one should not consider those as the basis for such an examination.
PHP has lots of MVC frameworks like CakePHP, Code Igniter framework and of course the Zend framework and and event based frameworks like Prado. Which means it has features of both RoR and ASP.NET..,
At our workplace we use Code Igniter: attributed to its reason of smaller learning curve and loads and loads of features.
In any day: an experienced PHP developer will opt out for PHP with such nice frameworks than RoR. The reason is Ruby is fundamentally OOP and unless we have some explicit reason to use. Ruby has larger learning curve.
As for code Maintainability: I think it depends on the project. Be it java/RoR/php ...
As for development tools: the person might be referring "eclipse" or IntelliJ IDEA. But IMHO Zend PHP Editor is much more sufficient for PHP scripting.
These are just my thoughts and opinions.
Not taking those into account is an interesting idea, I didn't even consider. But I also think it would extract the waste mjority of PHP usage. In the end it seems part of PHP's success is it's ease of use and it's low learnign curve. For Tim this mis the reason for PHP being so fast to deliver results. On the other hand Ruby being even faster is the result of it's well thought out OO approach and it's fitting Framework Rails. Now that PHP heads strongly into that direction we might beat all the others - as soon as we have unicode. [...] I think i should release re2c (http://re2c.org) 0.11.0 with full unicode support and then start working on the last bits in 0.12.0 to be able to replace PHPs lexer to solve a few remaining PHP/Unicode issues.
Link to comment
I agree with you, that the basis of PHP's success is the wast majority of new users, that can get started very quickly. But I definitly think, that if you start comparing PHP to Java to Ruby, you should not look at the beginners legue, but at the professional legue (as you do for the other 2 languages, too, since there is no wide beginners area).
Anyway, releasing re2c sounds like a very good idea to me! :)
Java scales, true. Also true is that Java has a huge amount of communication tools. On the other hand Java requires that communication and has to do with the problem that its script/code is designed to run longer than a single request. PHP on the other hand does not need any communication and does a perfect job in cleaning after a request - which Tim Bray referred to. As a consequence he, me and several other people come to the same result, it requires much more effort to scale in Java and it takes way more overhead in design, programming and computer/network resources. Since Tim Bray did an overall view the result can only be that PHP scales much better. I do not say that the PHP way is always the better one. If that was the case there was only one language. The reality is that a lot of tools are available and you have to choose, part of your decision should be the abilities/culture of your development team.
Link to comment
Bray says Java wins Tools and looses Speed?
Accidental joke?
Tim explains his Keynote a bit more in his blog (http://www.tbray.org/ongoing/When/200x/2006/11/10/Comparing-Frameworks), since some Java guys seemed to "dislike" it (see http://www.theserverside.com/news/thread.tss?thread_id=43020).
Link to comment
Yes there's opinions and caveats in the details but from a high level perspective it's great stuff.
I found the bar graph a great tool to explain to my client the trade-offs of choosing various technologies to build their initial web infrastructure. My client could care less if it's a framework or a language - they want to know what they'll be stuck with when our team is gone. As a consequence he, me and several other people come to the same result, it requires much more effort to scale in Java and it takes way more overhead in design, programming and computer/network resources. Since Tim Bray did an overall view the result can only be that PHP scales much better. I do not say that the PHP way is always the better one. If that was the case there was only one language. The reality is that a lot of tools are available and you have to choose, part of your decision should be the abilities/culture of your development team
Bray says Java wins Tools and looses Speed?
Accidental joke?
No, Java realy losses Speed
Fields with bold names are mandatory.
La Java avec Php sur les Rails !
En suivant le RSS planet PHP j’ai découvert un petit article intéressant de Tobias Schlitt à propos d’une conférence de Tim Bray
( Sun Director of Web Technologies ) qui a eu lieu lors de l’ “International PHP Conference 20...
Tim Bray (Sun) compares PHP, Rails and Java.
For his keynote at the International PHP Conference 2006, Tim Bray from Sun compared PHP with Ruby (in the form of the Rails framework) and Java.
Get the slides here.
This slide provoked some comments (1, 2) in the PHP blogosphere, of course, mainly