Poignant Guide to Ruby

If you don’t know I’ve recently become a fan of Ruby. If you haven’t heard of it before it is a new(er) scripting language. I’ve read descriptions of the language stating that it mixes the power of PERL with the object capabilities of Python. To be honest it is fully object oriented, unlike Python.

Having used PERL and Python in the past and knowing full well the things that annoy me about each I find that Ruby doesn’t have the same issues.

PERL is great in that it is very powerful and wide-spread. Just about every server out there comes with a PERL interpreter right there. Nothing to install. The language can be a bit cryptic though. For somebody that does a lot of PERL all day long the cryptic syntax is probably a breeze and may even safe coding time, but for more casual users it’s a bear to learn and remember.

Python is ok. I really wanted to learn and love it, but I cannot get over the very poor choice for indenting code to create blocks. Use a tab character where 4 spaces are supposed to be used and all kinds of problems occur. It may look good on screen, but the thing won’t run. If this syntax was not part of the language I could probably embrace Python, but I can’t.

Ruby seems to fit in the middle. Indenting rules are nonexistent. Syntax is in general terse, but it can cryptic if you choose to make it so. Unlike PERL Ruby does not force you to use cryptic syntax. Ruby is also extremely object oriented. You can execute methods right off of strings and numbers. No need to create an object to represent the number and run a method on that.

e.g.

5.times {
	puts "I like Ruby!"
}

Terse and to the point. Five times, execute this block of code. Not bad.

Ruby isn’t all that and a bag of chips though. It does have limitations that I don’t like, but I can live with. I18n is one limitation. Despite being written and primarily supported by developers in Japan, Ruby is not an i18n language. I can live with that since most of the apps I write are English only, but if I ever wanted to use it for something like Traditional Chinese I think I’m SOL.

Since Ruby is easily learned and I’ve had a chance to use it for a few tasks at work I’ve really come to understand the lanague. My next goal is to dive into Ruby on rails (if I was doing Python I’d learn Django, but I’m not). I’ve read a little about RoR and even toyed with the code, but without knowing the language I was left in the dark for the most part. I think I’m better prepared now.

If you’re interested in learning Ruby and need an entertaining non-orthodox book on the language then try out why’s (poignant) guide to ruby. I’ve been making my way through it and the first couple chapters were review, but I’ve learned quite a bit more in the remaining chapters. I’ve had plenty of “I finally get it” moments reading the book. As for entertaining and non-orthodox, well, you’ll just have to read it to see what I mean. You wonder if the guy is nuts or just a story teller, but in the end you actually learn something.


3 Responses to “Poignant Guide to Ruby”

  1. Dad Says:

    All I know about Ruby is, she wasn’t supposed to take her Love to town or something like that.:)>-

  2. sarah Says:

    nifty! my ex-coworker has been playing with ruby on rails for a while now and he loves it! it’s something i’d like to dive into at some point, but it’s one of those things i’d have to do on my own time, since it’s not something my boss would ever really let me do at work, which means it’s less likely to happen any time soon.

  3. Shaun Says:

    I’m sure you’d pick it up quickly. The basic concepts are the same it’s just the syntax. I think the best way to learn something like a new language is to get involved with a project that uses it. I wouldn’t be learning Ruby if I wasn’t using it at work. Otherwise, I would have started learning it months ago.

Leave a Comment

:) :( :d :"> :(( \:d/ :x 8-| /:) :o :-? :-" :-w ;) [-( :)>- more »