Little Known Ways to Ruby Mastery by Ilya Grigorik
30/Dec 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!
This week, we’re happy to have Ilya Grigorik from Canada.
Satish Talim>> Welcome, Ilya and thanks for taking out time to share your thoughts. For the benefit of the readers, could you tell us something about your self?
Ilya>> My name is Ilya Grigorik, I am a proverbial early-adopter of all things digital, and I am founder / CTO of AideRSS (a startup in Waterloo, Canada). My first website consisted of two dozen accounts on Geocities and Angelfire to host .bmp images for the images on my site as I didn’t know about compression, at the time. Since then, I have made my way through Perl and flat file databases, to PHP and MySQL, and eventually to Ruby and Rails. Nowadays, AideRSS is my full time job, and in between, I blog about lessons learned, software architectures, and web standards in general.
Willian Molinari, Brazil>> How should one go about learning the Ruby language? What material (books, eBooks, online tutorials etc.) would you recommend?
Ilya>> Pick a simple project that you can show off to your friends and jump right into it. There is a reason why “a blog in 10 minutes” is such a popular demo for most web-frameworks. The point is not in the blog itself, but in building something you feel ownership of and can use on a daily basis. Once you show it to your friends, you will feel the pressure (in a good sense) to keep it working, fix bugs, and add new features, which will keep you motivated.
In terms of resources, Ruby has an astounding number of great books and online resources. I highly recommend Ryan Bates’ RailsCasts series (start from the beginning of the archive). Also, visit your local bookstore and find a Ruby book. Personally, I am a big fan of “Ruby For Rails” by David A. Black. Last but not least, get involved in the Ruby community. Join GitHub, subscribe to RailsEnvy podcast for latest news, and join the #ruby channel on freenode.net IRC server.
Jerry Anning, USA>> Can you recommend things to study after learning Core Ruby, including different frameworks, gems and external libraries?
Ilya>> I know many language buffs who love diving deep into new languages just for the sake of it, but personally, I don’t subscribe to that philosophy. To me, the best way to learn a language is to align it with a personal project or a goal. (ex. a blog; a link sharing service; a command line script; a web-service to do x; etc.)
Hence, it is not about studying “the right framework”, instead find something that interests you, then find adjacent projects and dive right into it. My first Ruby-based web service was built directly on top of a TCPSocket class because that’s what I was familiar with at the time. I shared it with my friends and they recommend Webrick, Rails, and Camping and down the rabbit hole I went. (and never looked back!)
Dennis Theisen, Germany>> Could you name three features of Ruby that you like the most, as compared to other languages? Why?
Ilya>> When you look at a well written piece of code, it reads like poetry. I can’t explain it, but it’s just aesthetically pleasing, it has a feeling of craftsmanship.
Ruby has stolen a lot of the thought leadership from other communities. The reason for some of the “unstable” libraries is also because they are right on the edge of the current best practices (look at rspec, and a multitude of projects that sprung up around it). I think this is one of the core attractions of Ruby, and incidentally the biggest challenge moving forward is our ability to maintain the thought leadership by attracting the people who like to push through the boundaries.
The community. Ruby gets a disproportionate amount of attention on the web, largely because of the thought leadership, but also because we are good at promoting ourselves (one fuels the other). Look at all the conferences, meet-ups, blogs, and so on. It lowers the barrier to entry and benefits everyone involved.
Willian Molinari, Brazil>> What has been your biggest challenge while working with Ruby?
Ilya>> Beta-quality libraries. For all the hype around Ruby, a lot of the libraries are either unstable or unfinished. As Dr. Nic has pointed out, you have to be open to extending, and patching some of these libraries to get the results you desire.
Jerry Anning, USA>> What best practices are most important for a new Ruby programmer to learn and understand?
Ilya>> TDD. Now, I am not religious about it, and will openly admit that often I don’t develop in TDD mode, but to me, it’s not the process that matters, but the philosophy behind it. Namely, you will find that amazing things happen when you write down the requirements first, and then dive into the code you will finish faster, you will have a regression suite, you will have cleaner code.
In some ways, TDD is a close cousin of GTD (getting things done). And that’s what Ruby/Rails is all about a quick development cycle, user feedback, rinse and repeat.
Michael Uplawski, Germany>> According to you, what is a comfortable size of a Ruby/Rails-project? Why?
Ilya>> I don’t think there are any artificial constraints on the size of the project just because it’s written in Ruby. I think the more relevant question is your own comfort level with Ruby and what that means for the size of the project. If you are just a beginner, you should start small, and as you learn the architectural intricacies of the language, as well as, develop a mental map of best practices based on experience you can start moving into larger projects.
Michael Uplawski, Germany>> Having spent some years in the I.T. industry and coming to Ruby from a different background, how do I recognize Ruby’s limitations so as to suggest a different language in such cases?
Ilya>> There is no silver bullet for this question. Get to know Ruby, as well as, other languages. Read blogs, follow industry news. There is a great saying: “If all you have is hammer, everything looks like a nail”, don’t fall into this trap.
There are many cases where Ruby might not be the best fit, but that’s also subjective and conditional on your own experience, as well as, the experience of your team. For example, lately we have been hearing a lot about Erlang, but if you have a team of great Ruby developers, does that mean you should dump Ruby in favor of Erlang? Probably not.
Dennis Theisen, Germany>> Do you think Ruby is ready to be used in “Enterprise applications”? Kindly justify your answer.
Ilya>> I think this question should be reversed: “Do you think the Enterprise is ready for Ruby?” As a language, I think Ruby is ready. Yes, the MRI team has had some snafu’s with their releases, but JRuby and Rubinius have made a lot of progress in the past year and I am really glad to see that all of these projects are contributing to a greater whole: consistent implementation, a solid regression suite of tests, etc.
More importantly, I think the “Enterprise” is also realizing that they have to compete in a fast pace market. Gone are the days of 50 developer teams and six months release cycles. If they want to compete on the web, they have to adopt the latest best practices as something on which, whether you like it or not, Ruby and Rails has had a big influence on in past several years.
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?
Ilya>> Ruby has to be one of the best prototyping languages, and it really shines at that. I love the readability of the code, and the fact that there are always multiple ways to accomplish one thing and I know this is controversial, but I think this one of the reasons why Ruby has seen such an uptake.
The common complaint is performance, but Ruby can’t be all things to all people. When you start with Ruby you make a conscious decision to trade off some of the optimization in favor of a quicker prototyping cycle. And for the most part, I think this is a perfectly legitimate route because you can always optimize later. Ruby plays well with polyglot architectures, and there are plenty of examples of highly optimized Ruby code out there. First, you should prove that there is a reason for the projects existence (uptake in the market, open source contributors, etc.), and then you should focus on optimizing the core.
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?
Ilya>> Once again, find something that interests you, and something that matches your experience level. Many people recommend diving into Rails, but I think there are many smaller projects which are conceptually simpler and easier to get involved with. If you haven’t already, join GitHub and do a search for a project that might interest you “chances are, you are not the only one” then, dive right into source. Fork the project, fix a bug, send a “pull request” to the original author.
If you are a language buff, Adam Wiggins has a great how-to for getting involved with Rubinius.
Keith Brady, Australia>> What types of applications are currently being developed in Ruby and what changes do you foresee over the next year or two?
Ilya>> Ruby deployment is still painful, and for that reason I am really excited about projects like JRuby, Maglev, and mod_rails amongst many others. Likewise, Merb, and other web micro-frameworks continue to innovate around Rails.
I can’t predict where we will be in two years, but I hope we will have a faster MRI, an easier deployment model, and an even larger community.
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?
Ilya>> The future of Ruby is whatever we make it to be. Rails is why most people get into Ruby, and Ruby is why they stay in the community. It’s a beautiful language with a great community – what else could you ask for. If you want to see where Ruby is heading, visit GitHub (have I given them enough plugs yet?) and look at the recent and most popular projects. You will find telecom applications, midi generators, SMS gateways, web-servers, you get the point!
Ruby metaprogramming allows for very rich DSL applications, which makes it very well positioned for sys-admin, and domain specific projects. For some good examples, look at “Puppet”, or “God” projects.
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?
Ilya>> Remember that 10 minute blog that you built when you first started with Rails. Keep it up to date! I have gone through piles of resumes and in person interviews, and nothing stands out more than a personal web-site or a blog that has relevant content to the position I’m looking to fill. If you take the time to share a snippet of code, or talk about a problem you have overcome, you are instantly head and shoulders above the vast majority of resumes out there.
Satish Talim>> Do you have any other suggestions for these participants (would-be Ruby developers)?
Ilya>> Start a blog, join GitHub, contribute to a project, blog about it, then rinse and repeat. Before you know it, you will be turning down offers.
Satish Talim>> Thanks Ilya for sharing your views with the RubyLearning participants.
On 6th Jan. we talk to Josh Susser from USA.
Disclaimer:
The opinions expressed are those of Ilya Grigorik and do not necessarily reflect those of www.RubyLearning.com.
The Path to Ruby Mastery Series (So Far):
- #1: Jamie van Dyke
- #2: James Edward Gray II
- #3: Dr Nic Williams
- #4: Stuart Halloway
- #5: Jay Fields
- #6: Chris O’Sullivan
- #7: Guy Naor
- #8: Jonathan Conway
- #9: Ian Dees
- #10: Bruce Tate
- #11: Ezra Zygmuntowicz
- #12: Chris Matthieu
- #13: Peter Cooper
- #14: Yehuda Katz