Yesterday I went to Software Craftsmanship Conference 2010 at Bletchley Park.
The program consisted mainly of hands-on type sessions with occasional time out to visit the rebuild of Colossus and look at some of the history of computing they have exhibited there.
Here are the sessions I attended:
Refuctoring Master Class
This was a humorous take on refactoring based around the idea of ‘mortgage driven design’. First we looked at making the worst possible ‘Hello World’ code we could. I paired with Ivan Moore and we created a monstrosity using reflection that was brittle enough that even adding a comment would stop the unit test from passing. Then we had to take the role of an honest programmer trying to add functionality to the code that was created. The person trying to do that to the code we’d created was stuck with treating what we’d done as a black box and doing a search and replace on our output to add the new functionality.
For me the big lesson here is that bad code doesn’t just come from bad programmers, it actually corrupts future programmers. Even with the best will in the world, the programmer who came after us actually made the code even worse by working in it.
Using the Game of Life
The Game of Life is a simulation based on extremely simple rules that can give rise to interesting emergent behaviour. Because it’s so simple, it provides a nice exercise for coding. Some pairs did it using immutable structures in F#, I was in a pair that created it using processing.js, while others used scala and java and c#. At the beginning a one line implementation of it in APL, a functional vector language was shown. At the end people presented what they’d done.
Something I found fun was that after years of being regarded as a second class language, the pair that presented their javascript implementation running in the browser had at the same time created a large suite of unit tests and could show a very graphical result, while many other pairs had struggled to get much less impressive and well tested results. I think this emphasises that javascript + browser dom as the UI layer allows for very fast iterations, and I think this message is coming through.
Functional Koans
As David Laing explains it, Koans are snippets of knowledge expressed as a test. We were presented with a comprehensive series of unit tests, that taught and tested understanding of the chosen language. My pair worked in javascript, and it was an interesting experience. I think it may well be a good way to learn or deepen your understanding of a language. In javascript the test framework used was Jasmin. You can do the online version of the session here.
Call to Action
Jason Gorman gave an impassioned plea for craftsmanship in software. Here’s what he said (remixed via my brain):
“In 1943 there was one electronic computer in the world, and it was right here at Bletchley Park, the Colossus. Now they are in our cars, and our pockets, and there are 20 billion of them worldwide. That’s much more than there are humans. In twenty years, they’ll be like dust, swimming through our blood stream, deciding which cells to kill and which to leave alive, and who will have written the software they’ll be running? A VB programmer? The idea terrifies me. We are the thread on which the future is hanging.”