Sunday, April 15, 2007

Ruby on Rails VS PHP

I guess net entrepreneurs have some hesitations on choosing RoR or PHP for their new product.
I think an understandable post (for entrepreneurs) revealing advantages and weakness of each programming language with a direct comparison approach could help us in this choice.

As I’m not CTO, I’ll request developers to give their opinion and to bring value to this post. I don't think i can't make it in one shot. So i'll edit it each time i understand one additive thing on this subject.

I had several discussions with great young French developers such as Matthieu Aubry or Jérémie Bordier, Matthieu who build www.phpmyvisite.com (a Google analytics competitor) is basically more PHP addict, Jérémie is more pro Ruby...

What i understand by now is that Ruby is fully object oriented when PHP allow procedural & object approach. What’s make Ruby famous is his framework: Rails. You have to know that since rails exist, there were some frameworks developed for PHP also as PEAR.

Ruby's arguments:
. Easy to read & understandable
. Volume of lines reduced
. Easy and cheaper to make and maintain web apps' evolutions
. Faster to develop
. Geek Buzz for your project & trendy developers

PHP's arguments:
. Free to use and to install (Ruby is free too but Hosting companies don't install it for free yet)
. Still Faster in production
. Lot of experience around it (Allmost everything has been coded already)
. The biggest developers community (Think HR)

Ruby 1.9 with the new YARV interpretor will maybe solve the speed issue of Ruby in production. One example of bad optimisation of RoR on Twitter that drive costs in production :
http://www.ff00aa.com/fr/space/2007/04/12/340-ruby-on-rails-sur-un-gros-site/
Not easy to see this as a lesson cause we don't know if everything is well optimised here...
Franck Perrier reports me a great productivity gain on Eyeka using RoR.

Entrepreneurs have to manage human, business & technical aspects... This choice could impact both... But we have to insist on the fact that, whatever you choose, the success is mainly due to who is going to make it. I'm not really able to choose at this stage, some of you could help us! Feel free to contact me to give your opinion and let's share about it.
talongregory (at) yahoo.fr

------------------------------
Post edited 5 times with developers vision

5 comments:

Unknown said...

I quite agree with everything you said, but the "Free to use and to install" argument is also true for Rails of course. Entrepreneurs usually buys their own servers, and have to install PHP just as they would do for Ruby/Rails.
About the speed issue, i'm really looking forward to Ruby 1.9 with the new YARV interpretor which seems a lot faster, and more, to Rite, sort of bytecode compiled Ruby programs, best thing ever ;)

Finally, i think Ruby requires more resources at the moment to get the same production results as PHP, but that's just a matter of time, and regarding to the time you win besides, the choice is, from now, difficult.

Anonymous said...

IMO, advantages of PHP over the competition

- huge documentation + notes from users that answer almost everything you might ask
- huge community, which means thousands of existing source code that you can freely use in your application
- lots of extensions, tools to develop quickly, etc.

The remaining tech stuff (language, platform, etc.) is not so important, as it mainly depends on who will design & code your app. But whoever will develop, the fact that there is a huge doc, community and existing extensions and source code will help A LOT.

Matthieu

Julien Marie said...

Just a quote from a DHH article my dear Gregory (you can find it here.


If your app server costs $500 per month (like our dual xeons does) and can drive 30 requests/second on Rails and 60 requests/second on Java/PHP/.NET/whatever (these are totally arbitrary numbers pulled out of my...), then you're faced with the cost of $500 for 2.6 million requests/day on the Rails setup and $250 for the same on the other one.

Now. How much is productivity worth to you? Let's just take a $60K/year programmer. That's $5K/month. If you need to handle 5 million requests/day, your programmer needs to be 10% more productive on Rails to make it even. If he's 15% more productive, you're up $250. And this is not even considering the joy and happiness programmers derive from working with more productive tools (nor that people have claimed to be many times more productive).

Of course, the silly math above hinges on the assumption that the whatever stack is twice as fast as Rails. That's a very big if. And totally dependent on the application, the people, and so on. Some have found Rails to be as fast or faster than comparable "best-of-breed J2EE stacks".

The point is that the cost per request is plummeting, but the cost of programming is not. Thus, we have to find ways to trade efficiency in the runtime for efficiency in the "thought time" in order to make the development of applications cheaper. I believed we've long since entered an age where simplicity of development and maintenance is where the real value lies.


Take care !
Julien Marie

Unknown said...

Hi Gregory, at Eyeka, we used Ruby and it was quite a strategic decision for us. We have experienced great productivity gains from it. The downside is that in spite of its success, there are still few programmers....

Gregory Talon said...

Thanks for your feedback on this Franck, i appreciate.
I had the opportunity to discuss with Sebastien & Sanjay also.
I'm about to make the same choice with my new CTO.
It could be cool to discuss more when you want (not only on RoR i mean), if you're not too busy tell me!