Monday, June 26, 2006

Reading List

I've been doing a lot of reading lately. In fact I usually do a lot of reading and my wife, who is a voracious reader herself, is often puzzled by the amount of non-fictional material I pick up. I've been avoiding technical books for awhile now, it seemed I had just gotten too burned out with being a software engineer and so was avoiding that section of the bookstore. Recently, however, I've finished a major project at work (woo-hoo!) and I've been getting kind of restless. I wanted to spend some time refreshing my skill set, and learning something new in the field.

As a result, I've become very interested in Ruby and Ruby on Rails which seem to be taking the web by storm lately. My desk is now stacked with a number of books on the subject.

Ruby Programming, the Pragmatic Programmer's Guide now in it's Second Edition is the defacto standard on the Ruby Programming language. Ruby has been a bit of an ephiphany for me. The two facets (pun intended this time) of Ruby which make it so powerful in my estimation are the fact that it is a pure objected oriented language, and that the author and contributors have provided a rich set of standard methods which are inherited by all Ruby objects. Making everything in Ruby a first-class object means that you do not run into situations where you have to write reams of code to accomplish a task that should have been part of the language in the first place. That's an issue I am constantly running into with Java.

Take iterators and sorting for instance. Not all collections in Java are comparable by default, and sorting the objects they contain is often left up to the programmer. In Ruby, there are only two collection classes (arrays and hashes), however, they can be applied to any Object and provide a mechanism for sorting and iterating directly.

Ruby's syntax, while appearing to be a mix of Java, Perl and Python, actually is more closely related to Smalltalk. Because Ruby provides a rich set of methods and high level access to many features that programmers use frequently, it is quite possible to write Ruby programs in half the lines of code of Java. I've tested this myself by converting some of my own java applications to Ruby, and the lines of code measurement in Ruby is often as little as one third that of Java. There is good evidence that the length of time to complete a project is directly related to the number of lines of code. So it seems apparent that writing in Ruby could prove to be as much as three times more productive.

Of course, Ruby does have it's limitations. It is an interpreted language, which means it suffers from some performance issues. Code performance, however, is not nearly as expensive as programmer performance, and many companies are finding that getting small to medium applications up and running in Ruby is much faster, and far cheaper than doing so in Java.

Ruby on Rails may even be more interesting from a programmer productivity point of view. That, however, will have to wait for my next blog.

0 Comments:

Post a Comment

<< Home