At today's CodeMash Precompiler I decided to check out "Ruby 101" with Jim Weirich and Joe O'Brien. I've caught a few glimpses of Ruby code over the years but have never sat down to actually do anything with it. Since CodeMash is all about stepping out of your comfort zone and learning new things, I thought this would be a good session to attend.
The format for this session was pretty neat. Jim and Joe created a set of unit tests and distributed them to all of us. The unit tests were not complete – they didn't work. What we students did was work our way through tests and "fix" them so they'd pass. The tests were designed to be followed in a specific order and you'd gradually build on your knowledge of Ruby as you got the tests working.
Pretty much everybody liked the format of the class. When Jim and Joe first explained what they were doing, I though it was an awesome idea. In practice (at least for me), there were a few places where my lack of knowledge of some of the Ruby syntax hampered my progress. They weren't insurmountable challenges, but it was frustrating knowing what needs to be done to make the test pass (from a logical standpoint), but not knowing how to express that in Ruby.
Still, I really enjoyed the class. The unit tests had a very logical progression and built on each other. At the end, I was writing a proxy class which would intercept and forward calls to any object and would expose information like what calls were made to the object and how many times each call was made. Not bad for my first day of Ruby!
Technorati Tags: CodeMash