Monday, May 15, 2006

Learning Rails and Ruby

When was it again that the Ruby on Rails buzz started? I remember watching the Quicktime video (it wasn't this one: Creating a weblog in 15 minutes - but it was very similar) and having that sinking feeling that I was missing something important. I remember doing some research and trying to find the facts that would indicate that it was too good to be true.

Then I decided to buy this book: Programming Ruby (2nd edition). It was a setback. Having programmed in Python for 3-4 years by then, I was resisting learning Ruby - a language similar yet different. The examples from the early chapters didn't convince me enough to keep at it. I put the book on hold for a while and pursued other interests.

But Rails was always in the back of my mind. I remember discussing it with some colleagues and "forcing" them to watch the video (hey, it's only 15 minutes, right?). I did like to watch the look on their faces.

I was doing some more Rails research when I came across an article which basically said, get this book: Agile Web Development with Rails and to come back to Ruby afterwards. This was an important breakthrough in my Rails learning - I read the Rails book, learned Rails and was convinced to come back to Ruby -- I'm back on "Programming Ruby" these days ... it seems I get it now.

This reminds me of this quote: "I see a lot of Rubyists worrying that Rails is stealing the show. Geez, folks, LET it steal the show." from Steve Yegge's Bambi Meets Godzilla. Rails was, for me, a major incentive to learn more about Ruby. Not to say I wouldn't have gotten around to learning it anyway down the line... but Rails just brought a lot of attention to the Ruby community.

But one thing struck me last night as I was reading the book. Ruby is both more and less complicated than Python. For example, classes seem to be packed with more methods than Python, which seems like steepening the learning curve to me. And the syntax doesn't always seem as clean as Python's (I never minded the forced indentation in Python - that took me 5 minutes to get used to). And there's also these LISP reminiscent blocks and closures which I'm still trying to FULLY grasp.

So, why does programming in Ruby seems so natural then?

I can think of 2 reasons right now:

  • A lot of the minor annoyances I had when programming in other languages have been taking care of by Ruby. The sum of all of the little nice things in Ruby do add to a lot.

  • There is a "this-wasn't-slapped-together" feeling that I sometimes had in Java and even Python.


I'll have to think about that some more.

2 Comments:

Anonymous Anonymous said...

Hey, It's been a while since you wrote this but i came to your blog looking for Ruby excercises in Google. Right now i'm where you were at this post. I am not a programmer, i've been trying to be since i have a computer but i always end quitting, i've tried C, C++ and then Python and PHP. It's the lack of excescises that has kept me away from truly learn a language. I hope that ends now. I'm decided to do so. A few weeks ago i started to look for Rails info on the web, i can't remember why i did it but it felt right. I Saw the 15 minutes blog video and i decided to give it a try. I got Agile Web Development with Rails it was going very well, although i didn't what exactly was going on so i decided to learn Ruby first, and i'm reading the other book you said.

I high hopes that i'll last longer with Ruby, so far is a great, easy language to learn, i already have a project in mind(in Rails) so i don't have a reason to quit. Do you have any advices? Do you know a good page with excercises. I joined a course in rubylearning which started today. Let's see how that goes.

Good luck ... i'll get back to my books :P

4:31 PM  
Blogger Jonathan said...

Hey Daniel,

My blog now lives on wordpress. You've got good timing because I did a follow up post on programming exercises.

The list is based on what I used for Ruby and what I'm using for Erlang now.

Of course, you should pick a list of simple exercises that suit your style.

Enjoy!

7:53 AM  

Post a Comment

<< Home