Link Details

Link 43679 thumbnail
User 217101 avatar

By gst
via oreillynet.com
Published: Sep 23 2007 / 10:57

Back in January 2005, I announced on the O’Reilly blog that I was going to completely scrap over 100,000 lines of messy PHP code in my existing CD Baby (cdbaby.com) website, and rewrite the entire thing in Rails, from scratch. I hired one of the best Rails programmers in the world (Jeremy Kemper aka bitsweat), and we set off on this huge task with intensity. The first few months showed good progress, and Jeremy could not have been more amazing, twisting the deep inner guts of Rails to make it do things it was never intended to do. But at every step, it seemed our needs clashed with Rails’ preferences. (Like trying to turn a train into a boat. It’s do-able with a lot of glue. But it’s damn hard. And certainly makes you ask why you’re really doing this.)
  • 49
  • 14
  • 6583
  • 11
User 246172 avatar

LET ME REMOVE MY ACCOUNT replied ago:

0 votes Vote down Vote up Reply

Word!

User 238564 avatar

FlySwat replied ago:

1 votes Vote down Vote up Reply

*Dons Fire-Retardant flame Suit *

PHP is a ugly but functional language.

Ruby is a beautiful language and Rails assumes it is a hammer and everything is a nail.

User 186344 avatar

kunnar replied ago:

1 votes Vote down Vote up Reply

No silver bullet...

User 248808 avatar

hazlema replied ago:

0 votes Vote down Vote up Reply

Old PHP Code:
"Back in January 2005, I announced on the O’Reilly blog that I was going to completely scrap over 100,000 lines of messy PHP code in my existing CD Baby (cdbaby.com) website, and rewrite the entire thing in Rails, from scratch."

New PHP Code:
*- … and much more. In only 12,000 lines of code, including HTML templates. (Down from 90,000, before.)

This is a great saving for your line count, but makes me wonder if back when you made the first version you are really a decent programmer or just a script kiddie. While the language undoubtedly grew with new classes and methods, your original code package (by your own admission) seems excessively bulky, and the massive jumble couldn't just have been due to limitations of the language.

User 111696 avatar

bloid replied ago:

0 votes Vote down Vote up Reply
User 209172 avatar

mcnaz replied ago:

-3 votes Vote down Vote up Reply

I call super "fud" on this one.

I've developed http://pantherfotos.com in rails in about 3 months. It contains about 60 database tables which power: forums, blogs, photo uploads, google map integration, dzone/digg type listing directory, security, monthly memberships, e-commerce (selling of photos and photo albums), taxonomy (polymorphic) , an articles section, member clubs (with the ability for members to create public/private clubs and clubs to create public/private forums), RSS feeds (with geotagging where available) on pretty much everything, commenting system (with akismet integration) on everything (polymorphic).....

I probably forgot a few things there. Point is all this comes in at 6353 lines of code. It takes me under 30 seconds to update my website via Capistrano and Subversion.

PHP sucks balls. I know because I used it for three years. No PHP framework will ever turn me back to the shit side of the force!

User 225162 avatar

herval replied ago:

0 votes Vote down Vote up Reply

this guy doesn't seem to know a word on what he's talking about.. And his "I just prefer php, that's why it works for me" argument doesn't mean anything at all - doesn't matter if he was going from php to asp.net, cgi or whatever..

User 235696 avatar

Chaucerian replied ago:

1 votes Vote down Vote up Reply

I was going to vote this up until he admits rolling his own mvc framework. Regardless of which language/platform you use, this is plain craziness and an excercise in posing.

User 225135 avatar

Stefan Koopmanschap replied ago:

0 votes Vote down Vote up Reply

I love the flamewars that seem to erupt every once in a while between two (or more) languages. It's stupid. If PHP works for him, that's great. Let him use PHP. If RoR works best for you, that's great: Use RoR! But don't diss the other just because you don't use it.

I have respect for Derek. He actually threw away a 2-year investment (and that's an aweful lot of money!) because he realised that this was not the way he wanted to work. Independent of his technology of choice (whether he was ditching Java for PHP, PHP for Ruby, Python for Perl) that is a decision that should earn the respect of any developer and any business man.

User 235696 avatar

Chaucerian replied ago:

0 votes Vote down Vote up Reply

skoop, I hear what you're saying, but most of us dont know derek from a slice of pizza. But you have to admit it was an inflamatory article - what did he expect? Secondly, I would have to question someone's judgement if it took a whole 2 years to realise a project was failing, and then decide to reinvent the wheel. I'm glad it worked out ultimately, but in many people's eyes that would be a bad example of developing software - it feels like Ruby was initially chosen for the wrong reasons, whereas any developer worth their wage will have (at that time anyway) not recommended Ruby without much more careful consideration. A shining example of ruby for ruby's sake.

As I said, he may be successful on the whole, but this article deserves to be criticised, or eulogised - whichever works best for you.

User 225135 avatar

Stefan Koopmanschap replied ago:

0 votes Vote down Vote up Reply

Point taken. But still my original comment stands, as I was not directly targeting the article itself as more the flamewars resulting from the article, which as far as I've caught them seem more to attack him for his choice of PHP than either his initial choice of ruby without good resource or him taking 2 years to realise his mistake.

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Apache Hadoop
Written by: Piotr Krewski
Featured Refcardz: Top Refcardz:
  1. Play
  2. Akka
  3. Design Patterns
  4. OO JS
  5. Cont. Delivery
  1. Play
  2. Java Performance
  3. Akka
  4. REST
  5. Java