Community blog feed
Using Oblique Strategies for Difficult Refactoring
- Blog
- Anders Norås' Blog
- Posted
- 15 Oct 2008 at 20:58
Summary
Last year I wrote a lengthy guide from the trenches on how we can make unmaintainable code better. Lately I’ve often found myself caught between a rock and a hard place, doing my best to make the best out of untestable, incomprehensible stacks of code. As Bill Pierce pointed out in the comments to m
Post extract
Last year I wrote a lengthy guide from the trenches on how we can make unmaintainable code better. Lately I’ve often found myself caught between a rock and a hard place, doing my best to make the best out of untestable, incomprehensible stacks of code. As Bill Pierce pointed out in the comments to my previous blog post, such a task can be daunting. One of the things I find most difficult is figuring out where to start. Starting at an edge and nesting yourself into the code is a way to get going, but how do you find that edge when the code is hard to comprehend? Brian Eno and Peter Scmidt’s Oblique Strategies deck of cards has often been a source of inspiration for me when doing this kind of work.

The Oblique Strategies deck of cards was first published in 1975, and is now in its fifth edition. The deck was created as a tool to break creative blocks after Eno realized that he wasted costly studio time pondering over different things. Each card contains a phrase or cryptic remark which can be used to break a deadlock or dilemma situation. I’ve often regarded computer science as a creative craft, and doing nothing in a recording studio is just as wasteful as starting hopelessly into your computer screen trying to figure out what to do.
“These cards evolved from separate observations of the principles underlying what we were doing. Sometimes they were recognised in retrospect (intellect catching up with intuition), sometimes they were identified as they were happening, sometimes they were formulated. They can be used as a pack, or by drawing a single card from the shuffled pack when a dilemma occurs in a working situation. In this case the card is trusted even if its appropriateness is quite unclear…”
From the introduction to the 2001 edition of Oblique Strategies
Many of the cards have phrases that relate directly to refactoring. For instance “only one element of each kind” inspires me to go looking for repetitive chunks of code and make it DRY. “Bridges; -build -burn” can be a hint to look for over or under-engineered designs, “Accretion” makes me look for places where another layer of indirection might be appropriate and “You can only make one dot at a time” is a clue that I should abide the Law of Demeter. There’s even the “tidy up” card which reminds you that refactoring is needed.
The printed decks are hard to find and if you strike luck on eBay, it will set you back $40 or more. Luckily, there are other options. You can download this PDF and print your own Oblique cards, get this dashboard widget for your Mac or carry a virtual deck on your iPhone like I do.
Now it’s time to consult the deck on whether this post is done or not.

I guess so…