Tuesday, October 2, 2012

Ruby and the joy of programming

Years ago I used to solve many mathematical problems in Ruby. Looking backwards, I find difficult to explain my decision, because if I remember correctly Ruby was slow compared with C++ or Perl, and since most of the time I ended using a brute force approach to solve what my imagination could not solve efficiently I often ended awaiting longer times before obtaining my answers.

However, I can clearly remember that for the first time in my conscious programming life, I was happy and I was enjoying my time with some programming language. So I didn't worry too much about some additional time awaiting a stupid brute force solution. I was solving mathematical puzzles for fun and with Ruby I could quickly test some crazy ideas, leave the process running and go to do other things. Ruby was powerful, concise, elegant, and more importantly it didn't force over me its formatting policies or push me to do things in some way I didn't like to. I had finally found a language where everything fitted in place and seemed natural. I thought: this language must have been created by someone who really likes having fun while programming.

And indeed it was. Ruby was created by Yukihiro Matsumoto (aka Matz), who is one of my heroes actually. I found an interview he gave about Ruby and there he said something that really touched a fiber inside me, I have always used his words as an inspiration:

For me, the purpose of life is, at least partly, to have joy.
Programmers often feel joy when they can concentrate on the creative
side of programming, So Ruby is designed to make programmers happy.
Ruby inherited the Perl philosophy of having more than one way
to do the same thing. I inherited that philosophy from Larry Wall,
who is my hero actually. I want to make Ruby users free. I want to
give them the freedom to choose. People are different. People choose
different criteria. But if there is a better way among many
alternatives, I want to encourage that way by making it comfortable.
So that's what I've tried to do.
I want to solve problems I meet in the daily life by using computers,
so I need to write programs. By using Ruby, I want to concentrate the
things I do, not the magical rules of the language, like starting with
public void something something something to say, "print hello world."
I just want to say, "print this!" I don't want all the surrounding
magic keywords. I just want to concentrate on the task. That's the basic
idea. So I have tried to make Ruby code concise and succinct.
Yukihiro Matsumoto. (http://www.artima.com/intv/rubyP.html)
view raw gistfile1.txt hosted with ❤ by GitHub
Fun to use. Freedom to choose. This man taught me all.