Down the Ruby Hole… on Rails

Mint has been far more successful than I could have hoped. Mint is officially written, maintained and supported by one person. (That said, the contributions of Pepper developers and regulars at the Mint Forum should not be overlooked.) To date, I’ve been able to stay atop support requests and maintain customer communication through a number of disparate technologies. Mint itself notifies users within a week of their installation being out of date. I’ve used CampaignMonitor for urgent, one-way communication. A PunBB forum provides a two-way communication tool. Others have addressed needs in areas where the official site lacks. Peppermint Tea has become the goto for new Pepper releases.

What I am working on now is bringing all of that under one roof. Users should only need one login for the Account Center and Forum. When a user offers a new Pepper for download they should be given Pepper Developer status automatically. I want to know that a user is licensed to use Mint before fulfilling a support request.

For the past month I’ve been researching the right tool for that job. I picked up O’Reilly’s Head First Design Patterns to wrap my head around some formal programming ideas (MVC in particular), I’ve eaten Cake and even considered creating my own framework in PHP. I resisted learning a new language just to address this problem until Jeff posted a link to the recent Snakes and Rubies event.

I think it was David’s talk of beauty in his presentation that really sold me on Ruby. Having witnessed firsthand the knots PHP ties in your application logic because of its limited reference support and verbose object syntax, I was instantly enamored by Ruby’s terse, English-like appearance.

The next day I printed out Why’s Poignant Guide and read it in its entirety (weaving in the more academic Programming Ruby as breaks from the nonsense were needed). I was tempted to manually install Ruby, Rails, et al as described on Hivelogic but opted for the more Mac-like experience using Locomotive. I downloaded TextMate, CocoaMySQL and the RDoc Dashboard Widget and was on my way. (I’ve always found TextMate’s syntax-coloring for PHP too much of a departure from BBEdit to consider switching before—but when in Rome.)

Hours later I had written my first beautiful line of code in Ruby (part of an authentication system for the new haveamint.com):

access_denied unless account_owns event

What does all this mean for Mint?

For the application itself, not much. There are no plans to port Mint to Ruby or Rails (as I mentioned before, a framework would be overkill for the task Mint performs). The PHP/MySQL pair have achieved a level of saturation resulting in a very stable market for Mint in its current form (Mint can already be used with an app or site on Rails—or any other technology—by simply installing it on a subdomain capable of parsing PHP).

For haveamint.com, it will mean a single login, a more powerful account manager, an integrated forum and support system, the long awaited Pepper Mill, and a blog for Mint-related news and updates. I’m still a ways from launch but design and development is underway.

Previous
D.I.Y. Design Debate
Next
Sweet on Mint
Author
Shaun Inman
Posted
January 29th, 2006 at 1:34 pm
Categories
PHP
Mint
Web
Comments
024 (Now closed)

024 Comments

001

Cool, can’t wait to see it when it’s done. I’ve been putting off learning Ruby as well, but the Guide you linked might just get me on “the bandwagon”.

Author
Joshua Kendall
Posted
Jan 29th, 2006 9:05 am
002

Well, I’d like to officially welcome you to last year :) Better late than never.

Although, if I do say so myself — do not use haveamint as your first Rails application. You will run into problems due to unfamiliarity with the framework, resulting in a jumbled mess that you’ll end up hating rails for.

Instead, choose a side-project to build a rails app in. Maybe replicate Ta-Da lists, or something short. It’ll give you the time to wrap your head around how the framework works, and how it expects you to structure your programming. Also, I’d highly, highly recommend getting Agile Web Development with Ruby on Rails (In which the Depot application could be your first app).

Author
Kyle
Posted
Jan 29th, 2006 9:15 am
003

Don’t worry Kyle, way ahead of you. I’ve built a ta-da list clone. Haveamint.com won’t be my first attempt.

And my adoption of Ruby and Rails is hardly late. It’s hard to be late when the need has only recently presented itself.

Author
Shaun Inman
Posted
Jan 29th, 2006 9:19 am
004

My experience switching to TextMate was similar. I tried it out a few months ago, but also found the syntax coloring and anti-aliased Monaco too jarring. Since having a Rails conversion experience, however, I invested 20 minutes in making the syntax coloring more BBEdit-like and haven’t looked back. (Theme file available upon request).

TextMate is smarter in key ways than BBEdit. One of my big pet peeves with the later was its igorance of PHP tags embedded in HTML attributes (e.g. id=\"< ?php echo $id; ?>\"). TextMate gets it right — and even distinguishes it with a nice background color. Little things like this make TextMate a pleasure to use.

Author
Matthew Levine
Posted
Jan 29th, 2006 9:22 am
005

Have you been able to successfully run RoR on media temple yet?

Author
Juan Carlos
Posted
Jan 29th, 2006 9:29 am
006

Matthew, you should post that BBEdit theme somewhere, I’m sure a lot of users would appreciate it. I actually created something similar when I first tried TextMate but this time around I left the anti-aliasing alone opting for the Twilight theme—for the “full experience.”

A lot of the auto-formatting and bracket matching was hard to get used to at first because I had become so accustomed to doing it manually (doubling back with arrow keys to add content). I’m afraid TextMate is going to spoil me when composing comments in textareas!

Regarding auto-formatting, does anyone know how to use the auto-complete that shows up in all the Rails screencasts? Are those just custom Macros or a system-wide third-party application?

Author
Shaun Inman
Posted
Jan 29th, 2006 9:34 am
007

Juan, I’m currently developing locally using Locomotive. I haven’t tried installing RoR on my MT server yet but since I have a dedicated virtual server I don’t anticipate it being a problem. Famous last words right?

Author
Shaun Inman
Posted
Jan 29th, 2006 9:36 am
008

Shaun, All the auto complete things are done with the bundle editor. Just go to Window > Show Bundle Editor. If you look at the rails bundle you can see the shortcut commands and get an idea of how to home grow your own.

Author
John Nunemaker
Posted
Jan 29th, 2006 10:36 am
009

Thanks John. Wow, that’s pretty hot. I discovered a def shortcut by mashing the return and shift keys by mistake but I figured there had to be a more sensible way of figuring those out. I would have never looked under Show Bundle Editor.

Author
Shaun Inman
Posted
Jan 29th, 2006 10:38 am
010

No problem. I have never used BBEdit, but Textmate is flat out amazing. I have switched all my development into Textmate with the exception of the coldfusion that I have to code at work.

I use Encytemedia’s Vibrant Ink theme and have been very pleased with it. You should give it a try.

Author
John Nunemaker
Posted
Jan 29th, 2006 11:00 am
011

Dude you eat trix?

Silly rabbit…

(sorry couldn’t resist!)

Author
Tim
Posted
Jan 29th, 2006 11:02 am
012

Dude, you eat Trix?

Haha, nope but with a title like “Down the Ruby Hole” I had to work the rabbit in somehow.

Author
Shaun Inman
Posted
Jan 29th, 2006 11:04 am
013

I just wanted to welcome you to the Ruby Hole. I myself am working on my first large project after making some simple apps, so I wish you luck. As Kyle recommended, the Agile … book is great, as is just sitting around in the #rubyonrails channel. I’ve picked up a lot just reading other people’s questions and the responses.

Author
Paul O'Shannessy
Posted
Jan 29th, 2006 2:50 pm
014

I read this entire post and the most interesting thing in it, to me, is this: I inspired The Inman to do something, after The Inman has inspired me countless times…

…even if I did inspire you to pick the wrong framework. :)

(That’s a joke, of course. RoR is great in its own right. I’ve just been working with Django a lot in my new job and am really impressed with it.)

Author
Jeff Croft
Posted
Jan 29th, 2006 4:28 pm
015

Sorry to disappoint Jeff. :)

Author
Shaun Inman
Posted
Jan 29th, 2006 4:59 pm
016

What were wrong with cake man? I’m a PHP fan, and haven’t really wanted to jump to the rails side… but well, you are like my PHP hero so I’m feeling obliged to try RoR.

Author
sosa
Posted
Jan 29th, 2006 5:16 pm
017

For me it came down to syntax and documentation. Cake is still in a relatively early phase of development. A lot of the documentation despite being fresh is already out of date. That’s a big hurdle when trying to distance learn another developer’s framework.

I’m not swearing off PHP altogether (and I’m not suggesting that anyone else should either) but in this instance it wasn’t meeting my needs.

Author
Shaun Inman
Posted
Jan 29th, 2006 6:36 pm
018

I’m also a rather late RoR converter, actually when I first started with it, I never expected it to make my work that easy. It’s built-in support to AJAX with prototype.js and rich set of form validation really impress me. But one thing I get annoyed it’s naming structre.

Also wondering how it could safe Rails framework is ? When so many developers using the same naming convention whether there will be any chance to exploit ?

Author
LakTEK
Posted
Jan 29th, 2006 8:15 pm
019

Oh my God… you got me scared there. I almost thought another skilled PHP developer was lost to the Rails hype :P

By the way Shaun did you ever check out Symfony ?

It might just be what you need. PHP5 powered of course ;)

Author
Marco
Posted
Jan 30th, 2006 3:22 am
020

I actually did take a look at Symfony but discounted it because of the PHP5 requirement. I have a number of apps running on my server and I don’t want to worry about them breaking if I update to a new version of PHP.

Even if that wasn’t an issue, there’s still something refreshing about the terseness of Ruby.

Author
Shaun Inman
Posted
Jan 30th, 2006 4:40 am
021

Welcome over, Shaun. Before going on to create Rails, I spent about 5 years doing PHP. So I have a lot of sympathy for PHP refugees seeing the beauty of Ruby.

Author
David Heinemeier Hansson
Posted
Jan 30th, 2006 5:28 am
022

I’m going down the same rabbit hole. If I were needed to stick with PHP, and had the option to wait, I would probably hold off for the Zend PHP Framework.

Author
Brian Sweeting
Posted
Jan 30th, 2006 6:53 am
023

In my experience there aren’t really many PHP4 apps that break on PHP5 unless there’s shitty coding going on. If your project is not heavy on OO and you’ve already been using ‘new style’ superglobals there should’t be many big issues. If your project is heavy on the OO side you’ll have to look into the pass by reference vs. pass by value change that was implemented. Other than that? No problems.

It’s a shame it takes forever for developers to switch over. PHP5 is so much better than PHP4 in almost every respect. I’m quite sure this is also why a lot of people value RoR so much higher than PHP. The object model in PHP4 is total crap compared to the new one in PHP5.

Author
Marco
Posted
Jan 30th, 2006 1:20 pm
024

There is most certainly some shitty coding going on. These are apps I wrote as I was learning PHP so I won’t even contest that. They are important enough that I (and the community they serve) wouldn’t want them to break, but not important enough to sit down and recode (yet).

Author
Shaun Inman
Posted
Jan 30th, 2006 1:24 pm