Kata: Bowling


Accurately model a game of ten-pin bowling. Inspired by a mini-Code Retreat I attended years ago, and the front page of rspec.info.



Introducing Katas

Something I’ve really started to enjoy is working through software katas.

In karate, katas are exercises the student repeats many, many times. Each time through, the student will (hopefully) improve little by little in order to develop their technique and skill.

Similarly in software, katas are small, well-defined problems that are useful to practice software design techniques.

Inspired partly by Magnus Holm’s timeless repo, I’m going to post these kata here as embedded gists, so as I update them (and make more attempts at solving them) we’ll be able to see how my thoughts on software design grow and change.

The first one I’m going to put up is the bowling kata, and I’ll keep the full list up-to-date on the Kata page :)

Project Nov-Dec 2014: Making Soap

Why make soap?

So much of what we do as software developers is intangible - you can’t taste, touch, smell or feel code! I wanted to make something that was all of those (well, maybe not taste).

In 2011, I took a trip to the Middle East, where I visited a soap factory in Sidon, Lebanon. The same trip I bought some soap from Aleppo, Syria, and thought it was the most wonderful soap I’d ever used. Deep green, with a thick brown patina, it felt exotic to use and wonderful on the skin.

I decided that I would try my hand at soap-making. I’d never done much practical chemistry, and the thought of turning something you eat into something you could wash with was fun.

How does it work?

At one level, soap is Chemistry 101. You mix an acid with a base, you get a neutral salt. Soap is made up of two main components:

  • Lye (NaOH), which is a base
  • Some sort of oil, which is full of fatty acids.

With the right proportions and a good stirring arm, you’ll end up with soap!

This isn’t mine.

Did you learn anything?

Apart from how to make soap, I did learn a few things.

Be Prepared

Like lots of activities, soap-making works best if you have everything you need before you start. You also have lots of choices: what kind of oils will you use? Will you scent it? Will you follow the “hot” process or the “cold” process?

Because I’d thought ahead about my answers to these questions, I was ready when a block of time became available. I had what I needed, and I didn’t need to run out and look for an ingredient because I was ready.

Be Precise

Soap recipes are quite precise. I actually found the precision required comforting, for two reasons:

It helped me to concentrate on what I was doing.. Knowing too much lye or not enough stirring would ruin my batch scared me into focusing, being fully present.

It told me what to do next. I didn’t have to make lots of decisions on the fly, and I could concentrate more on executing instead.

Be Patient & Persistent

I knew what I wanted to do, and what I thought it would look like at the end. I still needed to do all the work required to go from ingredients to finished product. Following through and finishing gave me the real pleasure and satisfaction of a project completed. I got to use what I made, and I had pleasure in giving some away as gifts.

I’ll take these insights into my software projects, and my approach at work. I’m going to spell out what I need to do before I start, eliminate more distractions, and be thorough so when it’s done, it’s done.

Welcome to 2015

Hi everyone!

Another year has been and gone, and now 2015 extends before us as the Not Yet becomes the Has Been.

I have a few goals this year:

  • Say ‘no’ to more, and finish the ‘yeses’
  • Build routine
  • Tell more stories, better.

To achieve this, I’m limiting myself to the following two three simple rules:

  • You get one project a month.
  • You have to finish that project within the month.
  • Tell the story of that project, good or bad. “I just didn’t” makes a terrible story.

Like an agile project, I’ll maintain a backlog of projects, and if I choose to prioritise them then well and good. But during the month, I’ll focus just on that project.

Let’s see what happens :)

AAH14: Waleed Aly

AAH14 Keynote - Waleed Aly: Ethics & Technology

Waleed Aly considered himself a strange guest speaker for a tech conference, given his background in journalism, political science & law. I disagree, though - especially for a conference focusing on humanity.

He challenged us to think about the ethics of the space we’re working in at both micro and macro levels, and used philosophy as a backdrop for the conversation.

The world of philosophy is often ignored, but it provides invaluable questions of “Why?” and “Should?” that engineering, as a “How?” discipline, simply cannot.


Q: “Are there inherent ethical challenges to the technology I’m working on?” is a question we don’t ask ourselves enough. The tech sector has a tendency to focus on what is possible first, then work out whether we should afterwards (usually after it’s too late and we’ve already done it).

Take (as Waleed did) driverless cars. He transposed them into the famous “Trolley Problem” - where split-second decisions have moral questions. We afford ourselves a certain slack because in that situation it’s hard to know what we would choose. What about a machine, that by definition has to be told how to think? How should it answer the question? Even as technologists, ethics problems are our problems.

macro, or the myth of “neutral technology”

Q: Why do we tell ourselves technology is “neutral”, when it so often ends up causing changes for good and bad?

The introduction of the car changed forever the notion of the city. Television changed forever the notion of mass communication.

We tell ourselves that our technological changes (new platforms new media) are neutral - or at least that the net good will outweigh the bad. Why do we do this?

We talk about “the death of print” in the news industry, and assert that journalistic standards shouldn’t change. But how could we assume that standards wouldn’t change when new technology allows us to optimise speed over accuracy like never before?

We build drones, and drones that can wage war without people present. But what would war look like when attackers needn’t fear loss of their own life? Would they be more aggressive and kill more people? Or would they save lives by being more precise?

Waleed suggested that the tech industry perhaps unsurprisingly has more progressively-minded people in it than conservatively-minded. If we recognised that, perhaps we would make better-informed decisions about the social impacts our technological decisions might have.

aside: Technology & Worldview

During Waleed’s Q&A, someone asked questions as “a self-confessed ethics n00b.”. He worried the ethical conversations ended up being a waste of time because he left with more questions than answers!

That fascinated me, because we like to pretend we make decisions in a vacuum, or guided by “reason, science, facts, etc.” And, to an extent, we all do.

But we also see every fact, every piece of information through lenses, or worldviews. To deny that is the very essence of cognitive bias!

How could we, as people working in a quickly-changing industry, incorporate more mindfulness of our worldviews into what we do?

Above All Human 2014

This past week I got the opportunity to attend the inaugural Above All Human conference, held in North Melbourne’s Arts House Meat Market. Here are some thoughts & reflections I took out of it.


  • There are lots of conversations we’re not having as an industry. Ethics, diversity and responsibility often end up subservient to pragmatism, profit, and monoculture.
  • “Solving a problem” is a very broad statement. Some people’s problems are finding shoes that fit; others are finding capital to finance their businesses in places with no banking infrastructure. Others just want to find cool links on the Internet.
  • Just because people are internet-famous and can start cool businesses, doesn’t guarantee that they have insight to share.
  • Listen to people who are not like yourself, and you will learn.


Bronwen & Susan’s opening remarks

Morning keynotes Perhaps I was just more awake in the morning, but I felt it was the best part. The morning keynote-ish talks were awesome, and I’ll give them some air time of their own.

#aah14 The conversations happening on twitter were amazing, and having MC @mpesce actively participating helped those back-channel interactions feed back into the main show.

Diversity of speakers One of the organisers’ stated goals was to have a diverse lineup, across genders & cultures. I think they did a great job of that. The only piece missing were older people. There is a wealth of wisdom in the older voices in tech that would have been great to see there.

The venue all the tech conferences I’ve attended in Melbourne have been, sadly, a touch on the bland side. But the Meat Market was a great venue, and the mingling space outside the auditorium was a fun place to hang out, chat, and get refueled.


VC panel I was really interested in the questions being asked of the VC guests - about diversity in VC funding, approaches Australian companies can take in a smaller pond of money, and why an “exit” is pretty much the only strategy VC seems to be interested in.

Their answers? “I’ll fund what appeals to me”, “maybe you should just go to the Valley”, and “because 1000x, duh”.

A sad irony that those keen to invest in “innovation”, etc. feel no need (or interest) to innovate their own practices. What would disrupting the VC space look like?

YC Office Hours This was a strange segment - designed to mimic the YC pitching sessions, but on stage in front of an audience. It felt a bit like free advertising for YCombinator, and (even more oddly) most of the pitching companies didn’t seem that interested in their advice anyway. If I’d made any of those companies I suppose I’d be defensive of my baby too - but it made for a strange (voyeuristic?) experience.


Thanks to Bronwen & Susan for organising a wonderful conference. We need more of these conversations in our industry. Well done & see you next year!

The Curse of the Ideal Project

I confess: I have an ideas problem. Not the generation of ideas, oh no. My problem is what to do (or not to do) with them when they arrive.

Like many idealistically-bent people, I tend to like the idea more than the implementation. Why is that?

And it’s true: there is a certain (almost-Platonic) beauty to the Idea. (The idea of idea? #stackoverflow)

You imagine the finished product, and it’s wonderful. Oh, to have given birth to such an incredible x!

And then the tarnishing starts. The corrosive factors of
I don’t have enough time!, and
I don’t know how to do this - maybe I’ll fail!, and
oh, someone’s already made one of those!, and
oh! I’ve just had a great idea for a …

start etching away, and before long the sheen is gone.

Sometimes the tarnish takes longer to take hold than others. A lot of projects might even get started. But it’s rare that a project actually makes it to “finished”, because the inevitable disappointment when the actual fails to meet the Ideal feels too much to bear.

Wouldn’t it be so much nicer, your troll-brain says, if things just stayed as ideas? Why not give yourself the reward for coming up with the idea?

Ko-Ko: When Your Majesty says “Let a thing be done”, it’s as good as done, practically it is done, because Your Majesty’s will is law. Your Majesty says “Kill a gentleman”, and the gentleman is to be killed, consequently that gentleman is as good as dead, practically he is dead, and if he is dead, why not say so?

The Mikado: I see. (Dramatic Pause) Nothing could possibly be more…satisfactory!

The Mikado, Act II.

Only it isn’t satisfactory. Eventually, you’ll end up with a bunch of baby projects you killed at birth - because in the moment you decided Not Creating Anything was better than Creating Something Less than Ideal. And we don’t live in Plato’s universe. An idea is only a shadow without its fulfilment.

Who wants to live in a world of shadows?

10 Films

There are posts going around facebook asking what 10 books/films/tea blends have lasted with you over your life. Here’s my movie list, in no real order of preference.

The Life and Death of Peter Sellers (2004)

Worth watching solely for the incredible performances of Geoffrey Rush, this is a gritty (and contracted) biopic of one of the greatest comedians of the 20th Century. I really resonated with Sellers’ fear that beneath all the masks there was no essence, no Peter underneath. While this “allowed” him to immerse himself in characters like few others, it paints his life as tragically sad. Tough watching at times, but worth it.

2001: A Space Odyssey (1968)

A (very) long film, but its visuals are phenomenal given the time it was made. It deals with big themes (like the evolution of humankind), but most of the story is told in small segments. Our imagination is left to fill in the gaps, and it works very well.

Without that context, the psychedelia of the last 15 minutes or so will make no sense whatsoever. But if you’re prepared to invest in the big themes, this is a stunning piece of cinema history.

Gladiator (2000)

Another long film, and one I like for different reasons. I really like Russell Crowe’s portrayal of a loyal, dutiful soldier navigating a cunning, scheming world with integrity, even at his cost. Great soundtrack too.

Dr. Strangelove (1964)

or, How I Learned To Stop Worrying and Love the Bomb

Another Kubrick film, and another (kindof) Sellers film. The comedy is black as black, and full of the futility that marked the Cold War. This film wouldn’t be made today (because the “baddies” are much less centralised than the Cold War), but it does capture the gnawing feeling that one stupid renegade could bring the knife-edged balance of humanity crumbling down.

Network (1976)

Possibly my favourite film of all time. All the main actors put in stunning performances - it won 3 of the 4 acting Oscars in 1976. In fact, it holds the record for the shortest performance that won an acting award - Beatrice Straight won with only 5 minutes of screen time! (She deserves it, btw.)

While Dr. Strangelove looks at the Cold War through a military lens, Network looks through another lens - the camera lens of a TV studio. The callous way that people, current affairs, politics and even terrorism can be used for monetary gain get a caustic examination, with the lingering suspicion that even the “goodie/baddie” categories might themselves be a fabrication.

Worth watching for the stellar acting performances, and the prophetic (!) foreshadowing of reality TV.

The Matrix (1999)

Everyone knows this one. Solid cast, good storyline, amazing special effects, and kicking soundtrack. Shame they never made any sequels…

The Reluctant Fundamentalist (2012)

Found this while on honeymoon, and Verity kindly agreed to watch it. Tells the story of a young Pakistani man, who goes to chase the American Dream and support his family. But it’s on a collision course with his homeland, and he has some decisions to make.

Good, because it gives a non-American, non-Western voice to the modern conflict between militant Islam, imperial America, and the people who live under their ideologies.

Chariots of Fire (1981)

Finally a predominantly positive film! A great story about a Christian athlete who takes his faith seriously in a culture dominated by lip service. A compelling story, and there’s that opening sequence.

Remember the Titans (2000)

America. 1970s. Race relations. Reconciliation. Killer soundtrack. Denzel Washington & Donald Faison. #saynomore

Amazing Grace (2006)

Biopic about William Wilberforce, and his tireless attempts to abolish the slave trade in Europe. As a Christian who cares about the world, Wilberforce is a tremendous example of determination to right an injustice. It’s such a terrible shame that so many people around the world are still in slavery of varying kinds. Wonderful performances by Albert Finney as John Newton, and Benedict Cumberbatch (before he was Sherlock!) as Prime Minister William Pitt.

Lawrence of Arabia (1962)

I need to thank my brother David for inviting me to watch this.

Two things:

  • This movie, more than any other in this list (perhaps with the exception of the 2 Kubrick films) needs to be watched on a big screen. The cinematography is stunningly good, and gives a real energy to the desert. It was also shot on sumptuous 70mm film (with its 6-channel audio), so there is an incredible richness to the imagery and sound.
  • This movie is long. The director’s cut is 228 minutes, or 3 hours and 48 minutes in duration! There is a shorter re-release, but don’t bother. Watch it all.

Despite its historical setting, and the many things one can learn about that region of the world from watching, it’s more of a character film than anything. Lawrence gets caught up in events and, despite knowing more about the Arab world than many of his British colleagues, still manages to find himself on the wrong side of everyone, including himself.

Watch it. You won’t be disappointed.

Tech Talks: August 2014

I’ve recently been enjoying refreshing my Ruby testing & design skills, and these 3 talks have been excellent. They’re not new talks; I’ve seen some of them before. It never hurts to be reminded about good design and good practices!

The Magic Tricks of Testing

Sandi Metz

Watch it because: the rules for unit testing minimalism are actually kind of simple - we just need to remember them!

Yay! Mocks!

Corey Haines

Watch it because: Listen to your tests! If you’re finding pain in your tests, it’s a compelling reason to rethink your design. Also cats.

Refactoring from Good to Great

Ben Orenstein

Watch it because: vim ninja! The entire talk is done inside vim. Highly practical, and good arguments for keeping your public interfaces understandable.

Books I’m Reading: August 2014

I’ve recently started reading more, thanks largely to borrowing a friend’s kindle when on holidays for a month in June of this year. I’m glad I have, because there’s something great about getting immersed in a story - and that’s as true of non-fiction as it is for fiction.

Here’s what I’m reading right now:

At Home

Bill Bryson

Bill seems to be incapable of writing short books, but I’m thoroughly enjoying his look into the “home” and its history. I’m particularly struck by how recent so many of the innovations we take for granted really are - and it gives me a little bit more gracious towards the digital natives who can’t remember a world without iPhones.


Jon Acuff

This is a book full of home truths for Gen-Ys like me, who yearn to do work that matters but seem to have trouble working out how to get going. We’ve rejected the Greatest Generation’s tendency to work one job for life, and bought our Boomer parents’ encouragement that we could “be whatever we wanted”. Couple that with internet celebrity culture giving people fame seemingly from nowhere, it’s far too easy to get discouraged and discontented.

Jon writes as someone just that little bit farther down the road than you, which gives his message some weight without it being “preachy”. He is one of us, and he wants us all to do well. Don’t pick it up without being prepared to do a little introspection, but I’m finding that being honest with the questions it’s raising really helpful.

What are you reading right now?