Foreword to the
First Edition
Man is driven to create; I know I really love to create things. And while I’m not good
at painting, drawing, or music, I can write software.
Shortly after I was introduced to computers, I became interested in programming languages.
I believed that an ideal programming languagemust be attainable, and I wanted
to be the designer of it. Later, after gaining some experience, I realized that this kind of
ideal, all-purpose language might be more difficult than I had thought. But I was still
hoping to design a language that would work for most of the jobs I did everyday. That
was my dream as a student.
Years later I talked with colleagues about scripting languages, their power and possibility.
As an object-oriented fan for more than fifteen years, it seemed to me that OO
programming was very suitable for scripting too. I did some research on the ’net for a
while, but the candidates I found, Perl and Python, were not exactly what I was looking
for. I wanted a language more powerful than Perl and more object-oriented than
Python.
Then, I remembered my old dream and decided to design my own language. At first I
was just toying around with it at work. But gradually it grew to be a tool good enough
to replace Perl. I named it Ruby—after the precious red stone—and released it to the
public in 1995.
Since then a lot of people have become interested in Ruby. Believe it or not, Ruby is
actually more popular than Python in Japan right now. I hope that eventually it will be
just as well received all over the world.
I believe that the purpose of life is, at least in part, to be happy. Based on this belief,
Ruby is designed to make programming not only easy but also fun. It allows you to
concentrate on the creative side of programming, with less stress. If you don’t believe
me, read this book and try Ruby. I’m sure you’ll find out for yourself.
I’m very thankful to the people who have joined the Ruby community; they have helped
me a lot. I almost feel like Ruby is one of my children, but in fact, it is the result of the
combined efforts of many people. Without their help, Ruby could never have become
what it is.
I am especially thankful to the authors of this book, Dave Thomas and Andy Hunt.
Ruby has never been a well-documented language. Because I have always preferred
writing programs over writing documents, the Ruby manuals tend to be less thorough
than they should be. You had to read the source to know the exact behavior of the
language. But now Dave and Andy have done the work for you.
They became interested in a lesser-known language from the Far East. They researched
it, read thousands of lines of source code, wrote uncountable test scripts and e-mails,
clarified the ambiguous behavior of the language, found bugs (and even fixed some of
them), and finally compiled this great book. Ruby is certainly well documented now!
Their work on this book has not been trivial. While they were writing it, I was modifying
the language itself. But we worked together on the updates, and this book is as
accurate as possible.
It is my hope that both Ruby and this book will serve to make your programming easy
and enjoyable. Have fun!
Yukihiro Matsumoto, a.k.a. “Matz”
Japan, October 2000
Foreword to the
Second Edition
No one in 1993 would have believed that an object-oriented language created by a
Japanese amateur language designer would end up being used worldwide and that the
language would become almost as popular as Perl. It was insane. I admit that. I didn’t
believe it either.
But it happened, far exceeding my expectations. It was caused—at least in part—by
the first edition of this book. The famous Pragmatic Programmers chose a dynamic
language that was virtually unknown to anyone outside of Japan and wrote a good
book about it. It was just like a miracle.
That’s now history. The future starts now.We have the second edition of Programming
Ruby, which is better than the first one. It’s no longer a miracle. This time, the grownup
Ruby community helped to develop the book. I just needed to sit and watch the
community working together.
I really appreciate the Pragmatic Programmers, Dave Thomas and Andy Hunt, and
other people from the community who helped with this book (guys, sorry for not naming
you personally). I love the friendliness of the Ruby community. It’s the best software
community I have ever seen. I also appreciate every programmer in the world who
uses Ruby.
The stone has started rolling. It will became a great mountain and fill the whole earth.
Yukihiro Matsumoto, a.k.a. “Matz”
Japan, August 2004