I’ve admired James Gray for quite a while now and finally sat down to interview him by email. Most of us know him from the weekly RubyQuiz and the Pragmatic Programmers ‘Best of RubyQuiz’ book, but he’s made a lot more contributions to the Ruby community than just those. James always seems to have an answer to questions on ruby-talk (even the simplest), and his blog is a great read if you want to learn more about Ruby. Read on to learn a bit more about James and his place in the Ruby world.


How did you find your way to Ruby?

James: I came from the Perl camps, where I put in a few years. I always loved the raw power of Perl, but never fell in love with Perl’s object orientation. I’m Java Certified and really an OO guy at heart.

I was reading the Perl 6 articles as they came out (scary stuff!) and kept seeing the comparisons to this or that in Ruby. I had also read The Pragmatic Programmer and saw it mentioned there. I decided to take a quick look to see what all the talk was about…

I fell in love, obviously.

Ruby was what I had been wanting for years. The power of Perl with killer object orientation baked right in (better than Java’s even!). It was an easy sell. I’ve learned a little of other languages since, including Lisp and Lua, but so far nothing speaks to me the way Ruby does. We’re a good match.

You’ve been running the RubyQuiz for almost two years now. Did you ever envision it lasting this long, or being this popular?

James: It has probably lasted so long because I didn’t think it through very well before I started!

Seriously, I’ve been ecstatic with the success of the project. I started it for purely selfish reasons: I missed Perl’s Quiz of the Week (now defunct). I just wanted some fun Ruby exercises to play with. Of course, I seldom play them now, because I spend my time keeping them running. The irony.

I truly believe Ruby Quiz grew into a valuable community resource. I had nothing to do with that, but we got luck anyway. I see it recommended often as a place to look through Ruby code and learn new tricks. I have to agree. It’s certainly where I learned my tricks.

Let me sneak a huge thank you in here to everyone who helped make Ruby Quiz so cool! Every name in a byline on the site is part of the heart and soul of Ruby Quiz. They made it. I just did the paperwork.

All that said, Ruby Quiz cannot last forever, if I have to keep running most of the show. It takes me about an average of a business day a week to keep it going. I’m sure I’ll run out of good ideas eventually too. I’ve considered trying to find a partner though, so we will see what the future holds for Ruby Quiz…

Would you like people to contact you if they’re interested? Are you going to hold auditions or something to make sure any prospective quiz master is up to the task?

James: I have a Ruby Quiz chore I’ve been putting off for close to a year now, because I can’t seem to find the time for it. That would probably make a great audition.

People are welcome to email james@grayproductions.net if interested, but should be sure to reread the paragraph where I talked about how much work it is and know what they are getting into beforehand.

Which quiz has been your favorite one to review?

James: When I first started the quiz, I liked to use fairly complicated problems. (There have been complaints about this.) I was under the impression it made for better solutions and summaries. This is a myth.

Now I’ve really come to enjoy the easy challenges. More people try those, because they eat less time. Also, because they aren’t using all their energy to just solve the problem, we tend to see a bunch of really creative answers that show off Ruby well. That makes for good summaries, I think.

The recent Hash to OpenStruct and Bracket Packing quizzes are good examples of this.

Honestly though, I enjoy any quiz where I learn something while writing up the summary. Believe it or not, that’s most of them.

Which quiz have you found the hardest to complete?

James: The quizzes no one tries are the toughest, by far. It’s hard to get motivated to solve it and then talk about what I did. Besides, there’s usually a good reason no one tried it: too hard, poorly defined, or just too much work. I seem to have gotten better about catching these kinds of problems before they make it into the queue, but the old Yahtzee quiz sticks in my mind as a good example.

You and the Pragmatic Programmers have published “Best of the Ruby Quiz”. How did you select quizzes that went into the book?

James: When the Pragmatics approached me and we hammered out the details for the book, they wanted 25 quizzes. At the time, we were only in the teens. Thus, as I started to work, I took a large percentage of the early quizzes. Looking back this was silly, since Ruby Quiz moves faster than I write books. If you look at the (chronologically) later quizzes in the book, you can see that I’m skipping around a lot more by that point since I had more choices.

I generally picked quizzes that had been popular, taught me a lot, or just seemed to cover fundamental aspects of programming or common Ruby ldioms. That’s all based on my opinions of course, but I try to operate under the assumption that others will learn from it if I did.

Some summaries had to be completely overhauled to fit this vision. I write duds just like everyone else. In the end, I think that made the book stronger than the material it is based on. The overall goal and the desire to focus the problem into a mini programming lesson that could be reusable for the reader really helped the book summaries mature, I think.

The Code Cleaning quiz received no solutions, but still made it into the book and with minor editing at that. I felt it had value and I’ve received a lot of compliments on that summary, so it seemed worth an exception.

Do you think there will be a volume 2?

James: Ultimately that’s up the Pragmatics, but I can certainly say, “Not right now.”

I am currently working on my second book (another Pragmatic title), but it is not volume 2. I love Ruby Quiz, but I am involved in other projects and want to share my knowledge of those as well.

I’ve enjoyed many of your contributions to the Ruby community, especially your writing (your Higher Order Ruby posts on your blog are some of my favorites). What have you written that you’re really proud of?

James: Guess I should get around to finishing those last two Higher Order Ruby articles then, huh?

(Editor’s note — Yes, please!)

My blog was my New Year’s resolution this year and, unlike most of those, it seems to be working out well. I’m not much of a blogger and have made several failed attempts at them in the past. This one though is only about Ruby and in that, only about the parts of Ruby I want to talk about. That seems to be the right mix for me. I enjoy writing those articles.

I think my favorite article has been the one I wrote on testing, linked to from my blog. I passionately believe everything in there, so I had to take my stab at selling the masses, though many smarter than me have tried the same thing. I got a fair amount of positive feedback on it and it even got “digged,” which I’m happy to report didn’t slay my server.

In addition to that, I have given speeches about Ruby at a local university and for OK.rb. I am also pretty active on the Ruby Talk mailing list. I really enjoy answering even just the easy questions there, as funny as that sounds. I know that meant a lot to me when I was new, so it feels good to return the favor for others.

You started the OK.rb (the Oklahoma City Ruby Brigade) recently. What’s involved in starting a Ruby Brigade? What keeps it going?

James: In order to start one, you need a friend in NYC. Well, I did anyway.

Grant Schofield and I had both wanted an OKC area group, but somehow kept missing each other. When Grant was in NYC, he attended one of the Ruby meetings there and met my good buddy Greg Brown. Greg put us in touch and OK.rb was born.

Seriously though, Ruby has reached critical mass. It’s pretty easy to find people now, unless your in very remote areas. People are literally driving to OK.rb meetings from three states. There’s interest, if you can just tap into it.

Keeping it going isn’t too tough. Pick regular meeting times, keep getting the word out, prepare content regularly, encourage others to get involved, etc. A little passion goes a long way. Don’t think you need to be a Ruby expert either. A lot of people are just finding Ruby/Rails, so talking about your early experiences can be very valuable to them. Stay accessible to the group members between meetings. OK.rb uses a mailing list to keep the communication flowing. Be the driving force for your group to rally around and the rest will take care of itself.

What are your 5 favorite libraries/frameworks for Ruby (whether in the standard library, or off the ‘Net)?

James: I’m a huge fan of the standard library. I just dig poking around in there and playing with all the wonderful toys. Ruby ships with so many goodies! I seriously doubt I could pick just five favorites, so here are the ones I use often or just love to fiddle with:

  • drb
  • enumerator
  • erb
  • fileutils
  • forwardable
  • generator
  • logger
  • open-uri
  • ostruct
  • pathname
  • pp
  • pstore
  • rexml
  • set
  • stringio
  • strscan
  • test/unit
  • yaml

I use irb and ri multiple times daily too, of course. Also, optparse and webrick seem to get bad press these days, but I’m clueless as to why. I think both of them are terrific.

When you throw in the RAA and RubyForge.org it’s overwhelming. If I had to pick five favorites among those it would be:

See, I couldn’t even keep that to five? Too many good choices.

I also use my own FasterCSV a lot for my job.

I need to cover a lot more of these treasures on my blog!

What’s next for Ruby?

James: I think getting Yarv/Rite into everyone’s hands is a big next step and it seems like a lot of progress is being made there now. We’re all ready to play with the faster new architecture.

Thank you Matz, Koichi, and the rest of the core team for your tireless efforts to make something great even better!

What’s next for RubyQuiz?

James: At least three more weeks of submitted problems! How cool is that? That will mean we have had a run of eleven submitted problems, since you started us off with your great Refactoring quiz months ago. That’s huge. Keep them coming folks.

What’s next for James?

James: Oh boy… I never know that until I’m in neck deep.

In the immediate future, I am giving a Rails presentation to OK.rb on Tuesday. I’m looking forward to seeing those guys again. I’m also planning to compete in RailsDay 2006 on Saturday with Grant Schofield and Greg Brown.

Beyond that, I’m working with Benjamin Gorlick on his Summer of Code project to improve Ruby’s documentation offerings. I’m working to finish up the content translation so we can launch Ruby’s new home page, which is just looking fantastic (this is a mostly complete preview). I’m also preparing to attend my first RubyConf this year — very exciting. Finally, I am continuing to work on the new book, which I hope to be able to tell everyone about soon.

I’ve always got a few little side projects going on too. I’ve been toying with a framework for writing IRC bots in Ruby. There are some great choices in this area already, but many of them are light on (English) documentation. I’ve been playing around a little with porting Perl6::Form too, but that’s trickier that it seems at first glance. I also mocked up a protocol state machine parser for the EventMachine team. We will see what they think of that.

I like to work with a little of everything.


James is a contract programmer in Oklahoma. He works for multiple clients doing all manner of work with Ruby. He also builds Rails sites for HighGroove Studios. Lately, James has been busy writing books. He has published Best of Ruby Quiz, contributed to the Ruby Cookbook, and is now working on a new title. When James isn’t writing code, or books about code, he can often be found playing games or spending time with his lovely wife, Dana. He is very surprised people want to read interviews about him.

Pat is an Infrastructure Engineer for the LDS Church by profession, a Ruby geek by choice, and a writer by night. He enjoys reading, cooking, spending time with his family, and helping to build the Ruby community.