schlitt.info - php, photography and private stuff ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :Author: Tobias Schlitt :Date: Fri, 09 Jan 2009 12:34:32 +0100 :Revision: 2 :Copyright: CC by-nc-sa ==================================== Tim Bray compared Java, Ruby and PHP ==================================== :Description: 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: 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: .. __: http://php-conference.de .. __: http://en.wikipedia.org/wiki/Tim_BrayTim .. __: http://java.sun.com .. __: http://www.ruby-lang.org/ .. __: http://www.rubyonrails.org/ .. __: http://php.net |image_1| .. |image_1| image:: http://files.schlitt.info/blog/tbray_comparingintrinsics.jpg :target: http://www.tbray.org/talks/php.de.pdf 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. .. __: http://cakephp.org/ .. __: http://framework.zend.com .. __: http://pear.php.net .. __: http://ez.no/ezcomponents 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!** .. Local Variables: mode: rst fill-column: 79 End: vim: et syn=rst tw=79 Trackbacks ========== - La Java avec Php sur les Rails ! on Thu, 09 Nov 2006 16:32:07 +0100 in A bord du bebop 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. on Fri, 10 Nov 2006 15:55:27 +0100 in PHP, Mac, and more... 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 Comments ======== - Christopher Kunz at Thu, 09 Nov 2006 14:52:50 +0100 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... - Tim at Thu, 09 Nov 2006 15:19:07 +0100 I 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. - helly at Thu, 09 Nov 2006 15:30:09 +0100 You did not listen, he was comparing what is widely used. And in PHP there are tons of Frameworks but each with nearly unnoticeable usage. - Yannis Rizos at Thu, 09 Nov 2006 17:01:48 +0100 There is an extra "Tim" in the link to the Wikipedia article about Bray. - Markus Wolff at Thu, 09 Nov 2006 17:19:41 +0100 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 :-) - Felix Geisendörfer at Thu, 09 Nov 2006 18:01:43 +0100 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. - Toby at Thu, 09 Nov 2006 21:08:10 +0100 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. - CS Shyam Sundar at Fri, 10 Nov 2006 06:06:34 +0100 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. - helly at Fri, 10 Nov 2006 11:24:59 +0100 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. - Toby at Fri, 10 Nov 2006 11:29:07 +0100 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! :) - helly at Fri, 10 Nov 2006 16:01:50 +0100 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. - Python at Fri, 10 Nov 2006 21:21:28 +0100 Bray says Java wins Tools and looses Speed? Accidental joke? - Toby at Sat, 11 Nov 2006 03:42:06 +0100 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). - Essay at Tue, 23 Mar 2010 11:15:23 +0100 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 - programming help at Thu, 01 Apr 2010 11:29:18 +0200 Bray says Java wins Tools and looses Speed? Accidental joke? No, Java realy losses Speed - christopher EDWards at Tue, 22 Feb 2011 09:57:09 +0100 Welcome to our mitsole Data Solution. Click and get more information about mitsole Data Solution. ======================================== Mitsol Data Solution - sameer thapar at Thu, 29 Mar 2012 08:28:14 +0200 I seriously enjoy simply reading all your blogs. Just wanted to let you know that you have people like me who appreciate your work.