Ruby on Rails and PHP Revisited

10 Jul 2005

Since my last post a while back on my perspective on Ruby on Rails as a PHP developer, I’ve been watching Rails development and the Rails community, reading the beta book, and rewriting one of my apps with Rails. As a result, I want to write a follow-up to my previous post, and talk about some things that have changed since then.

Let me spoil the ending now by saying I’d be perfectly content to not work with PHP any more and focus primarily on Ruby and Rails. That’s not to say I won’t continue to do PHP stuff, but given the choice, I’d much prefer RoR to PHP with any framework. Now I’ll tell you why…

The short answer to the question of why is because I’ve been using it more. The more I’ve developed on top of the Rails framework, the more I’ve come to appreciate how it makes my life easier, helps me get done with the basic stuff faster, and, frankly, makes development more fun. For the longer answer I should probably address my own list of concerns from my previous post.

First, I’ve become convinced that I’d rather work on creating a site than creating a framework. I have to admit, it’s fun to build the whole thing from top to bottom, but in the rewrite I’m currently doing, I’m enjoying not having to worry about what’s going on below the surface if I don’t want to do so. Instead, I can focus on the problem domain, the relationships, the business logic—anything other than the plumbing. Then, if you add in all the AJAX and effects goodies that are just a few keystrokes away, you have one heck of a rapid development platform. And for someone who loves doing web development mainly because of the rapid nature of it, that’s something to get excited about.

Second, as a result of having to make a quick change of hosting providers, I’ve gotten familiar with lighttpd, which was a great experience. Lighttpd plus FastCGI is a potent combination, and, so far, seems to be easier to work with than Apache+mod_ruby. PHP is still ahead in the area of widespread support and ease of installation, but I’ve climbed the install curve myself now, so I’m not as concerned about it as I was. :) IIS is still a nightmare, though.

Third, my concern about significant changes happening to Rails as the revisions roll on has been lessened as I have watched the last few releases. The 0.12 release was still a bit loose, but 0.13 has gone pretty well, and (to me at least) it seems there is more concern on the part of the core contributors to stablize and verify as much as possible before blessing a new release. Now, remember, I’ve only been paying close attention for the last few months, so I may be way off there, but I like what I’m seeing in that department.

So, that’s it for my previous concerns, but those aren’t the only reasons I’m a Rails fan. A big reason is Ruby itself. A number of people have expressed this idea of really liking Ruby after checking out Rails, and I’m right there with ‘em. PHP 5 is much better than PHP 4 for those of us who are OOP fans, but PHP has nothing on Ruby when it comes to expressiveness and OOP-friendliness. Here’s a quick example, which will show my newness with Ruby, so bear with me…

I was pulling datetime fields out of a database, and wanted to display them in the format “4 July 2005”, but I found that strftime just didn’t support what I wanted, so I just added this code to one of my requires in the lib directory:

class Time
def to_s
day.to_s + ' ' + strftime('%b %Y')
end
end

Then all I had to do was display the database field, and it came out the way that I wanted. I’m sure there’s a better way to do it, but that solution seemed comfortable enough to me, and it kept my view code uncluttered. It’s pretty cool to be able to dig into these base (or any) objects and get what you want out of them. I heart Ruby.

Well, this post has been huge, so I’ll wrap it up: I’m lovin’ life on the Rails.

all estee lauder corporate site beautiful by estee lauder beyond paradise by estee lauder biography estee lauder care estee lauder skin cologne sale estee lauder cream estee eye lauder discount estee lauder discount estee lauder cosmetic discount estee lauder perfume discount tuscany perfume by estee lauder discounted estee lauder estee by estee lauder estee lauder estee lauder and global trade policies estee lauder automatic lip pencil estee lauder beautiful estee lauder beautiful gift set estee lauder beautiful perfume estee lauder beyond paradise estee lauder beyond paradise commerical estee lauder biography estee lauder bis estee lauder blush estee lauder bonus estee lauder career estee lauder co and economic political policies estee lauder co and globalization estee lauder compact estee lauder company estee lauder company history estee lauder company store estee lauder cosmetic estee lauder cosmetic bis estee lauder cosmetic online estee lauder cosmetics estee lauder discount cosmetic estee lauder double wear stayinplace make up estee lauder enlighten estee lauder eyeshadow estee lauder for man estee lauder foundation estee lauder fragance estee lauder fragrance estee lauder free gift with purchase estee lauder fruition extra estee lauder gift estee lauder gift set estee lauder gift with purchase estee lauder gratis estee lauder gratis award estee lauder gratis web site estee lauder idealist estee lauder idealist skin refinisher estee lauder intuition estee lauder job estee lauder job postings estee lauder job wanted estee lauder knowing estee lauder linen white estee lauder lip color palette estee lauder lipstick estee lauder lipstick bis estee lauder lipsticks estee lauder liz hurley estee lauder make up estee lauder makeup estee lauder martha stewart skin care or make up estee lauder mascara estee lauder model estee lauder models estee lauder new estee lauder oil free estee lauder outlet estee lauder perfectionist estee lauder perfume estee lauder perfume bis estee lauder perfume bis bis estee lauder perfume bis bis bis estee lauder perfume compact estee lauder picture estee lauder pleasure estee lauder pleasure exotic estee lauder pleasure intense estee lauder product estee lauder product to south africa consumer estee lauder products estee lauder resilience lift estee lauder review estee lauder roulette wheel compact estee lauder skin care estee lauder solid perfume estee lauder spa estee lauder sparkling clean estee lauder spellbound estee lauder spokesmodels estee lauder time zone eye estee lauder white linen estee lauder youth dew intuition by estee lauder job at estee lauder knowing by estee lauder life of estee lauder macys and estee lauder paulina porizkova estee lauder perfume estee lauder pleasure by estee lauder vinyl lip gloss andnot estee lauder rimmel wholesale estee lauder


Actions

Informations

4 responses to “Ruby on Rails and PHP Revisited”

Geoff (17:18:16) :

It sounds cliche, but I’ve been writing a custom Perl-app for a client over the past 3-4 months. I rewrote the whole thing in Rails over the last 3-4 days and will never go back to Perl unless I absolutely have to.

Rails makes website development fun!

ben (10:43:49) :

Now I have to check it out. I’ve been putting off learning RonR for way too long. Re the comment above… the best thing about Perl (besides it’s ability to be super evil) is CPAN. That’s the main reason I haven’t even checked out RonR – I mean – how could it top CPAN? :)

Doug (10:30:00) :

How weird! I am a developer, but also a golf nut. I hit this domain searching for Ben Curtis, the PGA golfer. But then this post was the top story on the page when I arrived. I picked up RoR in the last six weeks, doing my first real work with it after flirting with it since Memorial Day, and I will never choose to do another web project in PHP or Perl. Rails rocks!

theCreator (03:51:22) :

Agree. RoR is fantastic