Category Archives: Smalltalk Best Practice Patterns

Another Take on Smalltalk-Style Controll Flow (SBPP #6)

The latest Smalltalk-to-Ruby translation in my SBPPRB archive is “Dispatched Interpretation”. It’s one of the bigger ones I’ve tackled so far. I’m not going to go over the whole pattern here; for that you’ll just need to buy a copy … Continue reading

Posted in Smalltalk Best Practice Patterns | Tagged , , , | 2 Comments

Declarative Keyword Parameters in Ruby (SBPP #5)

Reading SBPP has got me thinking about keyword parameters. Ruby doesn’t have keyword arguments, but it fakes them pretty well: def explain(options={}) “the #{options[:the]} says #{options[:says]}” end explain the: “pig”, says: “oink” # => “the pig says oink” explain the: … Continue reading

Posted in Smalltalk Best Practice Patterns | Tagged , , | 8 Comments

SBPP #4: method Cascades

In Smalltalk, you can “cascade” side-effectful calls to the same object using the semicolon (;) operator. E.g.: If I understand it correctly, the semicolon is effectively a K-combinator or “Kestrel”. I am jealous. Sure, we have Object#tap, but that’s awfully … Continue reading

Posted in Smalltalk Best Practice Patterns | Tagged , , , , | 7 Comments

SBPP #3: Reversing Method

I’m pleased to find Kent Beck shares my affinity for methods with a consistent cadence. In the next pattern I translate, he looks for a way to bring a uniform rhythm to a method that writes an object to a … Continue reading

Posted in Smalltalk Best Practice Patterns | Tagged , , , | 2 Comments

SBPP #2: Smalltalk Patterns in Ruby

Smalltalk Best Practice Patterns continues from the introduction with a brief explanation of patterns. Some notable quotes: About leveraging commonality: “large-scale software re-use has not proven to be the answer”. A lot of the mid-90s OO PR centered around the … Continue reading

Posted in Smalltalk Best Practice Patterns, Uncategorized | Tagged , | 4 Comments

SBPP #1: Introduction

The Ruby Rogues are reading Smalltalk Best Practice Patterns for next month’s book club, so I finally got around to ordering a copy. It’s high time, considering that in my experience it’s one of the most consistently recommended programming books … Continue reading

Posted in Smalltalk Best Practice Patterns, Uncategorized | Tagged , | 4 Comments