Posts by
Geoff Bones

18 July 2014

18 July 2014

Code kata 7: Producer-consumer problem

First, apologies for nodding off and not posting for the last few weeks. I have the usual set of excuses, which you can guess easily enough without the need to read them here. So, on to the kata: something a bit different, this time. It’s a repeat of a kata we had a go... Read more

10 April 2014

10 April 2014

Code kata 5: SOLID chess

The kata Let’s get this clear: we’re not going to write a chess-playing AI in this kata. The idea is a bit more humble: to write a program that can work out valid moves for a set of chess pieces. The purpose of this kata is to practise writing SOLID code. Use TDD, but... Read more

19 March 2014

19 March 2014

Code kata 4: Word ladder

Naming things can be very hard, yet a well-chosen name can really help a reader understand how your code works. This code kata is an old favorite, one that we’ve done before, but this time we’ve added an emphasis on naming things well. The kata A word ladder is a sequence of words (each... Read more

24 February 2014

24 February 2014

Code kata 3: Refactoring

The kata This kata was inspired by a truly ugly piece of code we came across in Redgate Towers. It had a whole bouquet of code smells: long methods, a lot of indentation, static variables, inconsistent naming, code that was duplicated with small modifications, and a couple of small bugs. And, gloriously, it was... Read more

24 February 2014

24 February 2014

Code kata 2: Amaze me

The kata You are given a program which is capable of traversing 2D mazes. However, the solution isn’t perfect and fails to find the exit in certain types of mazes. Moreover, the current solution is messy, doesn’t follow any sensible coding principles (e.g. SOLID) and is completely untested. The input to the program is... Read more

30 January 2014

30 January 2014

Code kata 1: Old money

The kata Imagine: it’s 1968 – the Beatles, Carnaby St and Austin Powers – except there’s all the technology of 2013 as well. Including vending machines. But, being 1968, vending machines have to deal with old money. It’s quite simple; I’ll describe it here. Money is made up of pounds (£), shillings (s) and... Read more