The day was structured with 5 45-minute exercises, having 3 before lunch, and the other two after. There was a nice little breakfast put on with the help of a little money from Xero, and a great effort of muffins from my wife, Katherine. We had Subway catering for lunch, again thanks to the support of Xero. It was also great to be able to hold the event at Xero's Wellington office again too, using the large, sunny bull-nose area on level 2, and the well fitted Melbourne meeting room complete with a large TV to run our slides from. In fact, this is the 4th time this has run in Wellington, and all four have been able to use this space!
For those of you unfamiliar with the GDCR, this is a global, annual event created by Corey Haines that has been running for 5 years now, based on an idea that evolved through 2009-2011. Using Conway's Game of Life, programmers work in pairs to code up a solution in 45 minutes. The aim is not to solve the problem completely, but instead use its simplicity to explore features and techniques in your language of choice, especially things that you wouldn't normally do as part of your day job. This opens your mind to think differently, problem solve and come up with innovative solutions to interesting artificial restrictions against your language or tools.
After starting simple with everyone getting to write a standard solution once, Wellington this year ran through 4 constraints: No conditional statements, no loops, ping pong TDD evil coder, and no mutable state. Most of these I hope are self-explanatory, but I will elaborate on ping pong TDD evil coder as it is one of my favourite exercises.
Each pair is tasked with dividing the roles of developer, and test writer. The test writer writes tests without writing implementations, to guide the developer into writing the correct solution to the game of life. The developer has other ideas and writes the most ridiculous, incorrect code they can just to make the tests pass. The keyboard is passed back and forward in this fashion, up until half-way through the 45 minutes. Now we get the pairs to swap roles. The tester now writes the implementation code, and the developer now has to write the tests. To top it all off, we make everyone work in silence, so that they cannot discuss anything that is happening, and have to communicate in the reading and writing of the code.
At the end of each of the 45 minutes, we would take a break, and also get back together as a group to discuss the solutions, how teams went, and what interesting observations had been made. As expected, the first exercises only one or two people would talk in these discussions. But by the end of the day, most people felt comfortable and had something to contribute to the conversation. This also gave way to us being able to end by going around the room, and everyone was able to say one thing they learned, one thing that surprised them, and something they would start to use in their day to day.
One interesting observation that I made while watching one particular pair during the no loops exercise, was around the other rule of GDCR, that if you manage to complete the game of life inside the 45 minutes, you have missed the point. Pretty quickly, I noticed that these guys had "finished". I enquired about their solution, which involved using recursion to solve the looping problem. For most people, getting to this conclusion within the 45 minutes is a great result, but these guys already knew that answer before they started. I pushed them by saying "Great, now what if you can't use recursion?". This left them throwing around ideas until about the last 5 minutes where they came up with a great solution, but ran out of time to implement it. They didn't finish. So I was happy that they had not missed the point after all. What was their solution? I'll leave that open for you to think about on your own.
In the end, it was a successful day with everyone learning something useful to take back to their day jobs, and having enjoyed their Saturday. We ended in the time honoured tradition of tidying up and heading off to the pub.
A huge thanks again to Xero for being so supportive of this year's event. And I'd like to personally thank Jen O'byrne and Jean McClymont for giving up their Saturday to come along and help out, and Ben Amor for supporting me behind the scenes. Very much appreciated! And a small shout-out to Martin and Amy for handing over the reigns and encouraging me to make it all happen this year.