Coding Is Like Cooking

A blog by Emily Bache

Coding Is Like Cooking

A blog by Emily Bache

Coding Is Like Cooking

A blog by Emily Bache

We scraped by with the help of the audience

by | Aug 7, 2008 | Experience Report

stars day 2
We were up last this time, rather than first, and I was so impressed with the three pairs who went before us, they all paired really well and seemed to achieve what they set out to do. Joshua (one of the hosts) also decided to interview each pair just before they started coding (“so do you think you’ve got what it takes to go all the way?”) and I had no idea what to say. On the TV shows I’m sure they coach the contestants on how to respond to that kind of question, but I was too busy worried about how I was going to remember to type enough semi-colons to say anything coherent…

So, Michael produced some horrible looking C++ and led me through setting up a test so we could do “extract method” on a small portion of a hairy looking monster method. He introduced me to a technique called “sensing variable”. Basically you write a test that calls the long hairy method, and in the middle of the method just after the part you want to extract, you introduce a “sensing variable” – you assign the result of what will be your extracted method to this global. Then from your test you can check what the global contains, and write an assertion for it. The next step is to do the extract method, and the test then checks that the “sensed” variable is still the same. This should ensure that you didn’t make a mistake with the extract method, it is called, and returns the same as before.

It’s fairly simple really, but it’s the kind of thing you wouldn’t think of if it wasn’t shown to you. In a language like C++, you need all the help you can get.

Well, the judges had already awarded some very high marks to the other contestants, and our score was joint bottom, I think. Anyway, it went to audience vote between us and J.B. and Todd. They had done a teacher/pupil act similar to ours, on Eclipse wizardry rather than C++, and had raised considerably more laughs than we had. So I was a little surprised when we clearly got a louder cheer from the punters, and Jeff (the other host) announced we were through to the next round tomorrow!

Hi – I´m Emily!

I am an independent consultant with Bache Consulting and chair of the Samman Technical Coaching Society.  As a technical coach I work with software development organizations who want to get better at the technical practices needed to be agile, including Test-Driven Development, Refactoring and Incremental Design. I live in Gothenburg, Sweden, although I am originally from the UK. I’ve written two books: “Technical Agile Coaching with the Samman method” and  “The Coding Dojo Handbook”. I teach for both O’Reilly and  Pluralsight. I’m married to Geoff Bache, creator of TextTest. I am also on Mastodon as emilybache@sw-development-is.social.

Sociala ikoner med hovringseffekt

If you’d like to know a bit more about me, my work, and the talks and workshops I offer, please visit my main website: EmilyBache.com. There, you’ll find information about my background, upcoming events, and the services I provide as a technical coach and consultant. It’s a good place to start if you’re curious about how I can support your team in improving coding skills and agile practices.

Blog categories