David Flanagan talks to RubyLearning

O’Reilly Media, Inc. is a strong supporter of RubyLearning.org and recently announced a 50% discount, for the participants of the FORPC101 course, on their book “The Ruby Programming Language” by David Flanagan, Yukihiro Matsumoto. Satish Talim of RubyLearning recently caught up with David Flanagan who was kind enough to spare time answering questions posed by RubyLearning.

Satish Talim>> David, a warm welcome to you. For the benefit of the readers, could you tell us something about your self?

David Flanagan>> Hmm. Although I spend most of my time these days writing about programming, my training and my original career was as a programmer. I studied at MIT, and after graduation continued to work there, writing client-side applications for the X Window System (which was new at the time) and the Motif GUI toolkit. This was in C. HTTP hadn’t been invented yet, so we all had to make do with FTP. The internet wasn’t particularly new, but there were still more .edu sites than .com sites.

I broke into the writing business in the early 1990’s when O’Reilly hired me to write a book as part of their series on the X Window System.

Satish Talim>> David, you are one of O’Reilly’s most prolific authors, specializing in Java and JavaScript. How did you discover Ruby?

David Flanagan>> I first heard about Ruby the same way most people did: because of all the excitement about Rails. I didn’t pay much attention at the time, however, and didn’t really investigate the language.

Because of my success at documenting Java and JavaScript, my editor at O’Reilly thought I’d be a good person to write a book about Ruby.

Satish Talim>> How is your book different than Pickaxe?

David Flanagan>> My book is really focused on the core language and documents it in detail. The Pickaxe covers the language in less detail, but also covers the libraries and tools that surround the language.

My book has an extended tutorial that introduces the core classes and their API, but does not have a reference section like the Pickaxe.

You can learn Ruby from the Pickaxe, but I don’t think you can master it with that book alone. My book was written to be a definitive book on the language, and is intended for those who want to learn and master the language.

Satish Talim>> What role does Ruby play in your day to day work?

David Flanagan>> Surprisingly little, actually. Right now I’m writing some documentation for freebase.com, and that has involved some Python programming, but not Ruby. Ruby has become my scripting language of choice when I need to write a utility program of some sort. (Usually to process my documentation text files in some way.)

Satish Talim>> What did you learn from writing “The Ruby Programming Language”?

David Flanagan>> After being exposed to Ruby’s blocks, I came to really appreciate the power of tightly integrating closures with language syntax. The debate about adding closures to Java got underway while I was working on my Ruby book, and it is my experience with Ruby that makes me a proponent of the BGGA proposal.

Satish Talim>> For a Ruby newbie what’s the most important thing he/she should focus on, in Ruby 1.9?

David Flanagan>> Unicode support is the largest change, and will be the most important for anyone who works with anything other than ASCII. For the rest, the performance improvements in 1.9 will probably be the most important thing about 1.9.

I feel that most of the other new features of Ruby 1.9 are just conveniences. For example, I really like the new hash syntax that allows me to write {a:1} instead of {:a => 1}.

The fact that iterator methods return Enumerators when invoked with no block is somewhat confusing but very powerful and introduces a new way of thinking about iterations. Here is an example: a program that prints itself, with line numbers:

File.open(__FILE__) do |f|
  f.each_line.with_index { |line, number|
    print "#{number+1}: #{line}"

Satish Talim>> Any words of advice for a Ruby newbie?

David Flanagan>> Ruby is a different language than any that you already know, and it can take some time to get the feel of it. Like any language, it has some quirks that you may not care for. But once you get past those, the language really grows on you.

Learn Ruby for Ruby’s sake, and try to master the language. Don’t just learn enough Ruby to be able to write Rails programs. If you do that you’re in danger of doing cut-and-paste programming without really understanding what you’re doing.

Satish Talim>> What’s next for you?

David Flanagan>> I’m monitoring the development of Javascript 2 (aka ECMAScript 4) and will document it when it is ready. That looks like a very exciting new language.

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

Note: This interview is one of my ways of saying thank you to O’Reilly and not directly influenced or specified by the sponsors.

Technorati Tags: , , , ,

comments powered by Disqus