Ruby
Posted by Skrud at Wednesday, October 19th 2005 at 2:23am
When it rains, it pours. Learning the Ruby Programming Language is something I’ve intended to do for a long time. My summer reading list from last year included two Ruby books… unfortunately I think I only managed to skim through the first couple of chapters of Programming Ruby. (I did manage to read some seven or eight novels that summer. Ah… recreational reading….)
I remember over the summer hearing about how Matt intended to learn Ruby. Last week, Dave asked about finding some space to host the Montreal Ruby User’s Group, which is small but itching to have it’s first meeting. This reminded me that I wanted to learn Ruby and I think I brought it up to Harley later that day. On Saturday (I think it was Saturday, but I kept owl’s hours all weekend so it might have been Sunday) Harley called me to tell me about the ridiculously hilarious Why’s (Poignant) Guide to Ruby.
This guide is incredibly funny. And I don’t mean funny in a Learning Perl kind of way, I mean funny in a chunky bacon, elf with a pet ham kind of way. Why’s (Poignant) Guide to Ruby is loaded with comics containing cartoon foxes, the afformentioned elf, Dr. Cham the Grannybomber who travels to the planet Endertromb, a movie-watching goat, a ghost girl, and the list goes on. Throughout the guide, the reader will be confronted with bizarre tales of distant travels and unusual otherworldly systems, which are used to create scenarios that need to be solved through Ruby coding. On top of that, WhyTheLuckyStiff (his blog is almost as bizarre as the guide itself), has the most interesting and unusual way of describing programming constructs and concepts to the reader, advanced in programming or not. I even found myself describing parantheses to the students in my System Software tutorial as inner tubes, and the arguments are riding along with the comma representing their legs hanging over the edge of the tube… (this is straight out of the Ruby guide). I’ve never been so attuned to learning and reading so much in so little time, and it’s never been so much fun.
One of the great things about the guide is that not only does it teach you practical Ruby very quickly, with great mnemonics to remember some details, but it also shows you how to use the Ruby tools available to you, such as irb (the interactive Ruby prompt) and the ri tool to get information from any of Ruby’s standard classes. After reading the guide you’ll not only have a good idea of how to program in Ruby but you’ll have enough pointers and resources to be able to figure out the rest on your own! (You’ll also be able to construct a StarMonkey out of a coffee mug, an apple, and car keys).
I’ve also learned that Ruby programmers are for more insane than Perl programmers could hope to be. This is proven by Hobix, a Ruby-based blogging system that calls itself “the white pantsuit of weblahhing”. One needs only to visit their website to traumatize their children and their children’s children for 10 generations to come.
After spending a day or so reading the guide (I think this was Sunday), I realized that I had an assignment due for my Information System Security class on Monday. Then I remembered that sometime on Friday, after having pulled an allnighter working on two other assignments, I accidently deleted everyting my ‘Documents’ directory on my laptop. Not only that, but I also accidently emptied the trash. What’s worse is that I have a clear memory of doing this, deleting some 4,000 useful files, and then thinking “Hrmm… that’s a lot of files”. It wasn’t until two days later though that I actually noticed what I had done. (This proves that no user interface can match my stupidity, not even Mac OS X’s). This meant that I would have to re-implement my RSA-breaking program, from scratch. I figured I would do it in Ruby. So I did. You can view my source code if you’re so inclined. It takes up a good deal less code than it’s (lost) C++ counterpart.
So far, I really love Ruby. It’s like Perl, without the mess. It’s like C++ without the mess, too. :D






have you checked out ruby on rails??
That’s next. First learn Ruby, then add Rails. :D
When I was running around Prague last summer, I ran into this crazy Australian dude at the hostel really late at night, and we read Why’s Guide. It was weird, but a moment to remember.
Ruby is really cool.