Little Known Ways to Ruby Mastery by Chris O’Sullivan

by Satish Talim on October 28, 2008

A weekly series from the Ruby Masters

Welcome to the next 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!

Chris O'Sullivan, UK

This week, we’re happy to have Chris O’Sullivan from UK.

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

Chris>> I’m Chris O’Sullivan, an Average Joe Ruby on Rails developer working for a media agency in London, UK. I came to RoR development early last year after a long spell doing Windows development in .Net and Delphi. You can read my blog.

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

Chris>> Like a gigantic proportion of the Rails community I came to Ruby because I wanted to learn about Rails – and in my arrogance I tried to create Rails applications without first figuring out Ruby. Don’t follow my foolish example, and pick up a Ruby book first! After several false Rails starts I eventually picked up Mr Neighbourly’s humble little Ruby book from Lulu (written by Jeremy McNally) and found it to be a tremendous resource.

I also owe a tonne to Ryan Bates’s Railscast. Every week he manages to put together a magnificent video tutorial. It’s worth watching each and every episode, even if you’re not interested in the topic, as you’ll learn a tonne about Ruby and Rails best practices.

Another excellent reference is David Black’s Ruby for Rails. A lot of stuff in Rails just feels like voodoo magic, but David explains with blessed simplicity how Ruby enables all this magic to happen.

The best way to learn about a language though is to make something! Get started making a simple application, and you’ll learn gabillions more than just reading books or watching screencasts.

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

Chris>> The biggest challenge for me has been to trying to drop my statically typed habits. It’s entirely easy to program Ruby with a C# or Java style – but you miss out on all the wonderful juciness of Ruby. One of the classic examples is the Enumerable class. Coming from a statically typed language I kept finding myself write code like this:

for i in collection
  puts i.to_s
end

When you can so easily do something like:

collection.each {|i| puts i.to_s}

I’d also want to use standard inheritance to dry up my code – forgetting about the wonderous powers of mixing in modules.

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

Chris>> It’s incredibly important to be a test-a-holic. Test everything! Berate yourself if you write code that isn’t tested. Testing stuff can be real freaky hard though, but keep at it! I’m a huge fan of shoulda (although it’s quite Rails focused).

Learn about the whys and wherefores of mocking as well, your tests will thank you for it. Mocha is what I use with my mocking and stubbing.

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?

Chris>> There’s a gabillion open source projects to choose from, and they can all be found at github! Thanks to git (and github), contributing to a project has never been easier!

For most beginners, the problem isn’t necessarily which project to contribute to, but ‘what’ to contribute. A simple but affective way to contribute to a project is to write documentation. 99.99% of open source projects are severely under documented – but thanks to the beauty of rdoc, most Ruby source code has the documentation built in.

Another way of contributing to a project is by helping out with test coverage. Run a script like rcov on a project and you’ll see which bits of code aren’t covered with tests. Believe me, it’s not a trivial thing to contribute to test coverage, and you’re also less likely to contribute damaging code if you’re worried about that sort of thing.

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?

Chris>> Thanks to the plethora of Virtual Machines out there I see Ruby as taking a larger role in the enterprise. With JRuby and Iron Ruby it’s already possible to contribute to large enterprise applications using the sweetest of languages. The power of Ruby also means that you end up with more maintainable code, which will lead to cost-savings across the board which I’m sure large corporations will seize upon.

Satish Talim>> What can / should job candidates (for Ruby) do to distinguish themselves from their competition?
Note: The candidate has done his/her homework on the company that they are interviewing with. The candidate understands what they’re looking for, and the candidate is prepared to show them that he/she fits the bill, based on the candidate’s skills and experience. What else can the candidate do, to set themselves apart from other equally well-qualified and well-prepared candidates?

Chris>> The best way to distinguish yourself is to be a ‘giver’ developer. What do I mean? For years and years I was a ‘taker’ developer. Every day I’d scour the internet looking for solutions to my problems, but never contribute anything back to the community. I owe so much to random strangers all over the world! Eventually I realised that the more I gave the community, the more I got back.

To be a ‘giver’ developer do stuff like:

  • write blog posts about the problems that you’ve solved – chances are that if you had the problem someone else did as well. If you don’t have a blog (or don’t want one) answer problems in forums instead.
  • go on IRC and help newbie developers. These newbies are the future awesome developers, and one day they’ll be teaching you a thing or two!
  • contribute to open source projects that you use a lot. The more you contribute to a project, the more you’ll learn about it.

Get into the habit of being a giving developer and before you know it, you’ll find that people will be coming to YOU with job offers rather than the other way around! Future employers will be able to google your name/handle and see all the good stuff you’ve worked on.

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

Chris>> The biggest suggestion I can offer Ruby developers is to read lots and lots of source code. Coming from a .net world where source code is typically kept under lock and key, I hadn’t developed the habit of looking at source code. Now I read as much as I can!

A classic example is the Rails application – so many times I’ve found myself frustrated with the documentation of a given helper, but then realised that the best way to find out how a method works is to just read the source code. The more code you read, the more cool practices you’ll pick up, and the better you’ll become.

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

On 4th Nov. we talk to Guy Naor from USA.

Disclaimer:
The opinions expressed are those of Chris O’Sullivan and do not necessarily reflect those of www.RubyLearning.com.

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

Leave a Comment

{ 3 trackbacks }

Previous post:

Next post: