2004-12-30

Random Ruby links

Some stuff that has popped up in the last couple of days, that I thought might be of interest:



RPA Package Advisor

If you don't know what Ruby packages exist to solve some problem you're having—or, worse, you can't decide which package of several bets meets your needs—the Package Advisor can help.


This is a sort of review of packages, giving you the "best of" for common problem spaces. We try to include the major packages for each space, with a short overview of the pros and cons of each. For some problem areas, there is a single package that is considered "the standard" for Ruby, and only that single contender is discussed.

It's a Wiki page, so those of you who know Ruby better than I do are encouraged to add to it.


Method Check: defined?

A description of defined?, which apparently has the distinction of being neither operator nor method.


2004-12-10

First Pickaxe, Now Rails

Dave Thomas let slip yesterday that his next Ruby book will be about Rails.

Now "with juicy bits"

Thanks to Jarkko Laine (and apologies to loading the image from your website—either ecto or Blogger is preventing me from uploading it myself):



What's next? "Ruby—it's not just for breakfast anymore"?

2004-12-08

Ruby Katas

Speaking of Jim Weirich, he's taken up the challenge put forward by Dave Thomas and written some Ruby katas (programming exercises).

Deferring calculations in Ruby

It started with Patrick Logan: How would you implement spreadsheets as top-level programming objects? He's not talking about dropping a grid into your source file, but allowing deferred calculations. What he wants is the equivalent of something like this:



a = 10
b = a * 2
a = 15
puts b
>> 30

"Easy enough," I hear you say, "if you use a lambda (method object) for the value of b." Ah, but there are at least two wrinkles there. First, you need to write the value of b as a lambda, which requires more typing. Second, when you go to use b, how you use it depends on whether it's a constant or a lambda. The only easy way around the second wrinkle is to make all values lambdas, which brings us back to the first wrinkle. Patrick solves both of these problems by defining a Spreadsheet class that contains Cells that contain Formulas—all of which are smart enough to do the tedious stuff for you.


Fortunately (for those of us who aren't as fluent in Ruby as we'd like), Jim Weirich has provided a Ruby implementation.