Professional PHP

PHP Programming, Web Development, PHP Advocacy and PHP Best Practices.
« Mighty Mouse Kryptonite and Exceeding Expectations
Michigan Taxes Graphic Design Services »

Ruby versus PHP or There and Back Again

September 23rd, 2007

Well, I imagine that this opinion piece by Derick Silvers will cause some conversations: 7 reasons I switched back to PHP after 2 years on Rails. The gist being that a big bang rewrite of an existing code base is always a risk and that Rails is optimized more for the greenfield case. He talks about the beauty and power of coding in native SQL instead of database abstraction layers. I am sympathetic to that idea. He mentions hosting in that PHP is small and fast. To which I would add widely available and well known. He asks

IS THERE ANYTHING RAILS/RUBY CAN DO THAT PHP CAN’T DO?

And answers No with the comment

…when I took a real emotionless non-prejudiced look at it, I realized the language didn’t matter that much.

Now I disagree a bit here. It just happens that Ruby and PHP are equivalent in many of the ways that are important. See my post on comparing languages. PHP has some advantages with maturity, while ruby has some constructs, such as closures, that can do wonders in the hands of a skilled programmer. Yet, Ruby also has some disadvantages. I’d summarize that by saying it has all of the maintainability of perl with the commercial attitude of smalltalk.

One of the biggest themes of the 7 reasons piece is that he was able to bring much of what he learned from his 2 year failed rewrite in Ruby back to his PHP version. But, PHP is a different world today than it was two years ago when he made the decision to leave it for Ruby. PHP 5 is a more viable option. Additionally, the PHP community has learned from Rails. Some of the things that made the Rails framework a step ahead, for example routing and url helpers, are now widely available in the PHP world for those who want to use them.

Welcome back, we kept the light on.

categories Misc
tags

Related Posts

  • PHP Book sales trends versus Java and Ruby
  • Comparing PHP with other languages
  • Keywords and Language Simplicity
  • Programming Language Trends via Google
  • Why isn’t PHP the natural successor to Java?
You can leave a response, or trackback from your own site.

14 Responses to “Ruby versus PHP or There and Back Again”

  1. #1 Patrick Mueller responds...
    September 23rd, 2007 at 10:16 am

    I understand the maintainability of perl, but not so much the commercial attitude of smalltalk. Are you implying that Smalltalk never had good vendor-y, commercial support? Kinda like Ruby today? Because that’s not true; in the 90’s the only way to play with Smalltalk was to buy a very highly priced runtime from a vendor. Ah … those were the good days; I worked for one of those vendors.

  2. Paul M. Jones » Blog Archive » “Is there anything Rails can do that PHP cannot do? *No.*” pingbacked on September 23rd, 2007 at 11:08 am
  3. #3 Paul M. Jones responds...
    September 23rd, 2007 at 11:57 am

    Hi Jeff –

    But, PHP is a different world today than it was two years ago when he made the decision to leave it for Ruby. PHP 5 is a more viable option.

    Indeed; the same is true (perhaps more so) for Rails itself, which was built at a time when the dominant PHP version was still 4.x.

  4. developercast.com » O’Reilly Ruby Blog: 7 reasons I switched back to PHP after 2 years on Rails pingbacked on September 24th, 2007 at 7:44 am
  5. #5 Nate Klaiber responds...
    September 24th, 2007 at 8:37 am

    I appreciated his article and thought it was written very well. The one thing that I particularly enjoyed is his statement about SQL. Everyone thinks they need to avoid it like the plague, I happen to really enjoy it. I have found with Ruby that most of the time I end up using the find_by_sql statement because I have more control of the performance and end result. I did the same when I worked with PHP.

    You are also correct in that PHP has matured over the past 2 years.

  6. #6 Morgan Craft responds...
    September 24th, 2007 at 9:27 am

    He talks about the beauty and power of coding in native SQL instead of database abstraction layers.

    Amen!

  7. #7 Travis Swicegood responds...
    September 24th, 2007 at 11:00 am

    Oh come on Jeff, you’ve got to know that languages are just a vehicle and in the grand scheme of things don’t really matter that much… Well, unless you’re showing up to race a formula one event with a Pinto :-D

    Seriously though, its ashamed to see people drop Ruby - or any language really - simply because the framework they chose didn’t work out for them. It’d be like dropping PHP because (insert favorite framework, Zend, Cake, Solar, CodeIgnitor, etc.) didn’t work for them.

  8. PHPRomania Blog » Blog Archive » PHP vs Ruby pingbacked on September 24th, 2007 at 11:40 am
  9. All Night Coder - Today’s Top Blog Posts on Programming - Powered by SocialRank pingbacked on October 1st, 2007 at 5:10 am
  10. All Night Coder - Today’s Top Blog Posts on Programming - Powered by SocialRank pingbacked on October 1st, 2007 at 5:11 am
  11. Ruby Galore - Today Top Blog Posts on Ruby on Rails - Powered by SocialRank pingbacked on October 9th, 2007 at 1:04 am
  12. Nytt om webb » Facebook och PHP pingbacked on November 11th, 2007 at 2:25 am
  13. #13 Amit responds...
    March 13th, 2009 at 8:32 am

    Well, what would you suggest for a newbe?

    I want to program for website developing,
    I know a bit of PHP coding, and want to go with programing seriously.

    Will it be wise to invest all efforts on PHP or go with the Ruby?

    Thanks,
    Amit

  14. #14 Stuart responds...
    May 6th, 2009 at 5:09 pm

    It’s true, there’s not much that Ruby can’t do tbh.

    Coupled with the fact that you can do a large amount of the boring stuff quickly & easily it gives you much more coding time to pump into the stuff that matters.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

code: use [code=php][/code].

Comment Preview

  • Search

  • Subscribe

    Subscribe All Posts
    Subscribe All Comments
    Subscribe All Bookmarks
    Subscribe with Bloglines Subscribe with My Yahoo Add to netvibes Subscribe in NewsGator Online Add to Google
  • Share This

  • Categories (Home)

    • Agile Methods (14)
    • Mac (14)
    • Misc (17)
    • Open Source (14)
    • PHP (97)
    • Software Design (29)
    • Usability (14)
    • WACT (7)
    • Web Design (20)
  • Recent Comments

    • goto in PHP  45
      wawa, Riccardo Tacconi, Steve [...]
    • Building a culture of objects in PHP  6
      MagicCleanerU, hafizan, [...]
    • Working with PHP 5 in Mac OS X 10.5 (Leopard)  125
      ad, aankun, Hutch [...]
    • Comparing PHP with other languages  22
      ?????, ?y??, Olivier Lalonde [...]
    • WordPress BBCode Plugin  23
      AgeRLeloglalK, smolenskiy, wow [...]
    • Looking Towards the Cloud  15
      Robin, Mohammad, tsst [...]
    • Code Coverage, Feedback and Open Source  3
      rwer, sdfsdf, mayur
    • Firefox Extensions for Web Developers  16
      Salman, Markus, Mitch [...]
    • php | tek Wrapup  6
      Livetek Software, PHP Guru, Scott [...]
    • OOP is Mature, not Dead  15
      Fernando, Chabrell Igan, deltawing [...]
    • nofollow and comment spam  4
      Mozzgggos, sss, Nataly Marshak [...]
  • Pages

    • Tags
  • Recent Posts

    • Looking Towards the Cloud
    • Holiday Tech Support
    • Closures are coming to PHP
    • php | tek Wrapup
    • php | tek 2008
    • Sarah Snow Stever
    • Benchmarking PHP’s Magic Methods
    • The Endpoints of the Scale of Stupidity on Video
    • Working with PHP 5 in Mac OS X 10.5 (Leopard)
    • Keywords and Language Simplicity
  • Archives

    • 2009: Mar Apr May
    • 2008: May
    • 2007: Jan Feb Mar Apr May Sep Oct Nov
    • 2006: Jan Feb Mar Apr May Jun Jul Oct Nov Dec
    • 2005: Jan Feb Mar Apr May Sep Oct Nov Dec
    • 2004: Apr May Jun Jul Aug Sep Oct Nov
  • Menu

    • Register
    • Log in