
A couple of posts ago I mentioned my brand new development box, workstation, computer, toy or whatever you want to call it. I've been tinkering with it since that post and it is still the bee's knees. As of right now it's running a browser (chromium), an email client (Thunderbird), an instance of Windows 7 running in a virtual machine (virtualbox) that's busy running some ham radio software and the Zune music software, an IRC client (xchat), and somewhere down there in the silicon maze are daemons for apache and mysql and other things that come to think of it don't take up a lot of resources. I even kicked up the CPU clock speed to turn it from a 3300MHz processor to a 4000MHz processor, and it's not even heating up significantly.
This is sort of like when I bought my banjo almost 10 years ago now. I wasn't absolutely sure at the time that I should be spending the money on a toy when there were other things I could have been doing with it, but I've never looked back, and look at the friends it's helped me make and the fun I've had doing it. The only regret is that I didn't do it many years ago, and I could have been having all that fun this much longer.
Similarly, when I'm out of work it seems a bit foolish to spend about $400 on a new computer. But I don't look at my computer as a toy. (Well, not entirely, OK?) I look at it as a tool. Computers are how I make my living, and like I said before, the old one was driving me around the bend because it was so underpowered. I can do things on this computer I can't even do on my laptop (a dual-core 1.8 GHz machine from when Windows Vista walked the earth), much less the old single-core 1.3 GHz machine. With any luck at all this machine will last me another 5-6 years, or until software starts outpacing the hardware again. But running today's software on XUbuntu 12.10, it is great.
One of the things that a blazingly fast computer doesn't help with is doing the actual programming. Someone once said that most of a computer's time is spent waiting for you to do something, usually type in a command or click a mouse. That's true as far as I can tell. The browser comes up fast and the mail is pretty quick, but if I'm writing a program it still takes me the same amount of time to type in the code or debug it. I get the results faster, but for the stuff I'm doing now, imperceptibly so. Then again there are the times I had to wait for the old computer to play catch-up in some other process before I could get back to work, so I'm glad I don't have to worry about that at the moment.
While I'm knocking around the house looking for work I have been working on improving my skill set. Part of that is learning new languages and new technologies. I was once labeled a "one-trick pony" by an interviewer; fortunately I got that job since the one trick I knew (Perl) was the one they wanted. I'm trying to shed that these days by learning some new skills, languages and technologies, or at least getting an idea of what they're about so if someone says they want a guy who knows something about Hadoop, Nagios, Nginx or Puppet I can discuss them semi-intelligently rather than saying "Nope, no idea" or, worse, something dumb.
To that end I've been working on learning Ruby. Ruby is sort of similar to where Perl was 15 years ago, a hot scripting language that's making its presence known as an engine for creating interactive web pages. It's a typical open source success story, similar to the one behind Linux itself. In 1993 a Japanese programmer named Yukihiro Matsumoto (known to one and all as "Matz") decided that the scripting languages available to him left something to be desired, so he set out to create his own that was "more powerful than Perl and more object-oriented than Python." I don't know if it out-muscles Perl, but it is certainly object oriented. Everything in Ruby is an object, including what would normally be simple primitives like integers.
Ruby was first released in Japan at the end of 1995 and interest was pretty much confined to Japan for about four years, when the first English-language Ruby mailing list started up. It gained a modest following, but really took off in 2003 when David Heinemeier Hansson was developing an application that would eventually become Basecamp. He was working on some web scaffolding for Basecamp, and realized that with a little work he could create a general purpose web application framework, which he released under the name Ruby on Rails. (Again, this is similar to the history of Perl, where Larry Wall realized that a one-off script to do some text parsing could be expanded into a general purpose Practical Extraction and Reporting Language.) In some ways Ruby on Rails is Ruby's killer app; it does a lot of the heavy lifting involved in creating an interactive web site, and it does it all in Ruby. "Ruby on Rails" is one of the most common desired skills I've been seeing while doing my job search.
Before I dive into Rails I want to do some general purpose scripting in Ruby to get a decent grounding in the language. To that end I've been rewriting some projects I've done in other languages in Ruby. For instance, I have an application I wrote that sends a bunch of tweets at regular intervals. It's written in Java, in part because I wanted to say I had written a Java program. It took me about three days to get everything written, tested, debugged and functioning, and even so it still isn't working 100% right (in part because I don't have my class path set to work properly from a cron job . . . but I digress).
Today I got out of bed at about 8:30 and decided I wanted to convert this script to Ruby. So my morning looked something like:
8:30 - get up, get showered and get dressed
9:00 - sign on to boris (my big bad dev box) and in a separate window load up sitka (the remote server the Java code is on)
9:05 - copy the list of tweet contents from sitka to boris. Close the connection to Sitka. Format the strings for use in Ruby (mostly removing the String identifiers in Java - Ruby uses flexible typing, similar to Perl)
9:30 - install the Twitter Ruby gem (package) and take a look at the documentation
9:45 - create a sample tweet with the Twitter gem and see it appear in my timeline
9:50 - Do a little more experimenting with the gem to see how tweet objects are formatted (for use later)
10:10 - Write the code for sending the tweet lists. Test it. Fix a few bugs and try it again
10:45 - Run a full simulation, not sending tweets but testing the timing
11:00 - Done. Off to answer my mail and contact some of my recruiters.
The Java original took me three days to complete. Now granted I already had the login information and the strings I want to tweet, but putting the Ruby version together took me less than two hours, and that was with breaks to look up code examples online.
My goal is to get somewhere near the expertise I have in Perl as fast as possible, preferably within a month or two. If today's experience is any indication, I may be able to reach that goal with time to spare.