Little Known Ways to Ruby Mastery by James Edward Gray II

by Satish Talim on September 30, 2008

A weekly series from the Ruby Masters

Welcome to the second installment of the weekly interview series on the RL blog – “Path to Ruby Mastery” – by top trainers and developers in the Ruby community, from across the globe. The interview series will provide insight and commentary from these notable Ruby trainers and developers, with the goal of facilitating and providing answers to the questions Ruby beginners face. We welcome your suggestions for interviewees and questions. Look for a new post every Tuesday!

James Edward Gray II, USA

This week, we are happy to have James Edward Gray II from USA.

Satish Talim>> Welcome, James and thanks for taking out time to share your thoughts. For the benefit of the readers, could you tell us something about your self?

James>> My name is James Edward Gray II and I’ve been trapped in the Ruby community for almost five years now. I keep trying to get out, but this place is just so much fun I can’t seem to break away.

I’ve tried to give back some contributions for everything Ruby has given me. I started the Ruby Quiz and ran it for the first three years, I wrote documentation for some standard libraries including ERb and PStore. I created some open source libraries including FasterCSV and HighLine. I wrote a couple of Pragmatic Programmer books with lots of Ruby in them. I speak at some Ruby conferences, and I now help maintain a few of Ruby’s standard libraries.

My day job is building Rails applications for Highgroove Studios.

Willian Molinari, Brazil>> How should one go about learning the Ruby language? What material (books, eBooks, online tutorials etc.) would you recommend?

James>> Books, tutorials, and similar reference materials are wonderful and very needed. However, I truly believe there is only one way to learn a programming language: write 500 programs in it. Obviously I just made that number up, but the point is the same. You learn to code by writing code.

Programming is about learning to think like a computer. The languages are very small compared to those we speak, so that’s not the challenge. The challenge is learning to think like a very dumb machine. To do that, you need to have a lot of conversations with the machine. You have to learn how it thinks and give it a chance to dumb you down. That means feeding it code and learning to interpret those cryptic error messages.

Given that, my number one recommendation for those learning would be to get a pet project and dive right in. Choose something you are interested in or just a simple project that could save you some time with work. Read reference materials as you go to learn the part you are working on now. Ask questions on Ruby-Talk when you get stuck. The most important thing though is to keep writing code. That’s how you learn. Believe it.

Keith Brady, Australia>> What are the pros and cons of Ruby that are being discussed in the development community and what is your opinion on that?

James>> You’ll hear a lot of people say, “Ruby is slow.”

That can be true, but it doesn’t have to be. I just gave a presentation at the LSRC that showed multiple ways to get Ruby to do work in fractions of a second.

My opinion on the speed rumors is that you shouldn’t believe everything you hear. I’m sure there are tasks Ruby is too slow for, but there are also a surprising number of tasks where you can make it go fast enough.

Willian Molinari, Brazil>> What has been your biggest challenge while working with Ruby?

James>> I am in the middle of replacing Ruby’s old CSV library with my FasterCSV code base. Part of that process includes reworking the parser to work well with 1.9′s m17n implementation. That has been pretty tough.

Part of that is because Ruby’s m17n code is new and still has some minor oddities. That’s improving all the time though as we find bugs. The bigger issue is just that character encodings are hard to get right, especially when working with non-ASCII compatible encodings like UTF-16.

In a way, you can argue it is a testament to the new m17n implementation that it is making it possible for me to get CSV working with so many popular encodings. I won’t kid you though, it was hard work.

Jerry Anning, USA>> Can you recommend things to study after learning Core Ruby, including different frameworks, gems and external libraries?

James>> I’m a huge fan of Ruby’s standard library. Ruby ships with so many great tools. I can’t count the number of times I’ve seen someone working on a tough problem and I showed them how to solve it with a require statement and a line or two of code to make use of a standard library.

Plenty of these libraries are still missing documentation too, so it’s an excellent opportunity to take your first steps into the community. Crack open one of the libraries, put on your code investigation hat, and try to figure out what it is capable of. Call methods in IRb and try passing them different kinds of data. Take notes as you go and you can turn those into documentation to help other programmers. It’s surprisingly fun.

Satish Talim>> Most beginners in Ruby, would like to contribute their time, skills and expertise to a project but invariably are unaware of where and how to do so. Could you suggest some?

James>> I asked this exact question at LSRC panel with many smart Rubyists including Matz and Dave Thomas. Their answer: be passionate about what you do. That’s great advice.

The biggest thing I can suggest is to get involved today. There are ways you can help no matter what your skill level is. I’ve already mentioned a documentation tip, but there are plenty of others. Get involved with some Ruby project that interests you. Join their mailing list and help answer questions there. Offer to build a web site for the project if they don’t have one. Or just install the test release of Ruby 1.9, play around a bit, and write blogs posts about the new features. Don’t be shy.

Remember, helping the community isn’t just about being generous. You are building your portfolio that a future employer will see as an added bonus.

Victor Goff, USA>> How do you see the market for Ruby Programmers in the work place, and do you see it as primarily tied to Rails and Web related work? Do you see trends in administration or other work? What’s the future for Ruby?

James>> I would definitely say that Ruby is seeing the most use currently in the Web application world. That’s not all it can do though and some brave souls are pushing those boundaries!

Ruby has begun to make some inroads into the sciences. NOAA used Ruby to analyze satellite images of that damage caused by Hurricane Katrina, I spoke with a genetic researcher doing some genome processing with Ruby at the LSRC, and even NASA is using Ruby on a few projects now.

That’s just one field. Ruby is ready for us to take it into many new fields. My hope for the future is that we take Ruby to new places and do for them what we’ve done for web development.

Satish Talim>> Do you have any other suggestions for these participants (would-be Ruby developers)?

James>> Be immune to the word “can’t.” There are two kinds of people, those who say they can’t and those who aren’t afraid to try. Be one of the latter. Succeed or fail that’s all it really takes to be a hero.

Satish Talim>> Thanks James for sharing your views with the RubyLearning participants.

On 7th Oct. we talk to Dr Nic Williams from Australia.

The opinions expressed are those of James Edward Gray II and do not necessarily reflect those of

The Path to Ruby Mastery Series (So Far):

Post supported by Blue Box Group: Blue Box Group is in the business of providing affordable Ruby on Rails hosting solutions! They approach web hosting, virtual servers and dedicated servers differently, treating each client as a partner and working towards the common goal of success for their business. From shared Ruby on Rails hosting to giant production clusters, they have the experience, talent and equipment to make your site a success!

Technorati Tags: , , , , ,

Posted by Satish Talim

{ 5 comments… read them below or add one }

Hugo September 30, 2008 at 6:00 am

Nice interview!


George Thompson September 30, 2008 at 6:50 am

I heard James Edward Gray II speak at Lone Star Ruby Conference. He spoke on Hidden Gems extolling the virtuals of 4 Gems that can be useful in your projects.
NArray, RBTree, SQLite3 and Rinda. His presentation was one of my favorites from the conference. He did a great job championing Ruby and these 4 gems.


ashbb September 30, 2008 at 12:57 pm

The most import thing is to keep coding, to take noting and to be passionate. Great advice! I’m deeply impressed. Thanks.


Raul Parolari September 30, 2008 at 1:03 pm

I have read some of James E. Gray’s posts in forums, and I was always delighted by his humor (and his code).

Regarding the question “best way to learn Ruby”, I thought that his answer (“write many programs… you need to have a lot of conversations with the machine”) is right for programming languages in general, but that Ruby demands something more. But this may depend on what he means for conversations with (the machine) Ruby..


Eleudson Queiroz September 30, 2008 at 4:31 pm

I like the idea of learning to talk to the machine and I believe that Ruby allows is the focus of the conversation and not the complexity of the rules of syntax or grammar of the language.
As an interpreted language, allows a fluent conversation. And yet being fully object oriented, the contents of the conversation can be exposed in a way closer to us that human use among us.
Of course, considering all limitations of the machine as our speaker.


Leave a Comment

{ 14 trackbacks }

Previous post:

Next post: