Celebrating a fantastic Code Retreat day

Today, Saturday 7th May 2011, there were six code retreats around the world! They were in Belgium, Spain, UK, USA, and two in Romania! We all did the same challenge: implementing Conway’s Game of Life in pairs, using test-driven development, in iterations of 45 minutes, discarding code at the end of every iteration and pairing with somebody different for the next iteration. We introduced a few extra challenges in every session! ;)

I co-facilitated the code retreat at Sheffield University. We had 18 participants: a good mix of computer science students, professional programmers, people who code for fun, and someone who seemed to have been dragged along but got thoroughly stuck into solving the problem along with everyone else! :)

Tom Crayford co-facilitated with me, and Chris Murray ran around making sure everything went extremely smoothly.

Code Retreat Sheffield - Coding

In iteration 1 we gave everyone chance to explore the problem without heckling to see how they would do. The only special challenge was to pair with someone they didn’t know. In the retrospective we talked about the languages and classes used.

For iteration 2 we talked about TDD as in, letting the tests really drive the code in the direction they want to go. We challenged people to do the very simplest thing they could possibly do at each stage. Many people found themselves writing unnecessary code, so we kept bringing them back to the rules of the game. The retrospective brought up questions of where to start, and whether a cell should be responsible for its own state, or whether a separate entity should know where all the cells are.

In iteration 3 we encouraged people to try a different starting point, to see how that worked. We stipulated that the code could not contain any booleans, like true or false or strings or numbers representing boolean states. The third iteration was sneakily only 30 minutes long, which we didn’t tell anyone until after the retrospective! There was a good discussion about using a grid to hold the cells, versus having an array of cells who know their coordinate position.

Code Retreat Sheffield - Skype link to Timisoara

Throughout the day, at various points, we were able to have Skype video calls with other code retreats. We found this very enjoyable: we discussed the different implementation options with other people who were also tackling the same problems. During the day, Sheffield managed to communicate with all the other code retreats: Valladolid in Spain, Cronos in Belgium, Bucharest and Timisoara in Romania, and finally, towards the end of our day, Pittsburgh in Pennsylvania, USA, just as they were at the end of their second iteration.

Code Retreat Sheffield - live updates!

We also had two projectors constantly showing the twitter #coderetreat hashtag on tweetviz.com and a slideshow of pictures on hashalbum.com. These things really helped us to feel connected to a bigger community of people sharing a similar experience at the same time.

Code Retreat Sheffield - Lunch

After lunch we introduced Keith Braithwaite’s TDD as if you meant it and for iteration 4 we challenged people to obey the strict structure given. The purpose of this was to really break everyone’s normal processes to avoid mental shortcuts. It really ensures that the solution is exactly what the tests require, and nothing more. It was a tough challenge but it was taken well. A lot of people found they came to a better solution when these restrictions were applied.

In iteration 5 nobody was allowed to use if statements. (Or case statements, ternary operators, etc.) We also focussed on ping pong pair programming. This is where one person writes the test, the other person writes just enough code to make it pass, then writes the next test and hands back. During the day i had seen a lot of rather uneven pairing, where one person was doing most of the work, and the other was mostly just watching and commenting. Ping pong helps to address that by bouncing back equally between the two. Comments in the retrospective were that you had to concentrate harder, and felt more engaged because of it. I was surprised that many people had not paired that way before.

Iteration 6 was the last one for us. (Unlike Valladolid who went on to 8 iterations!) We gave people a bit longer and told them to just enjoy this one. The restrictions were that no method could be more than 3 lines long, and the code you wrote had to be the best you could possibly do. You had to write something you could be totally proud of. For most people, they said their code wasn’t the best they could possibly do, but they were definitely proud of it! :)

Code Retreat Sheffield - Retrospective

At the end of the day we did a raffle. Entry to the raffle was by way of a donation to Bletchley Park, for which we raised £200. Names were shuffled in a Ruby array and winners received either a copy of Apprenticeship Patterns or a software craftsmanship motivational calendar.

With that done, all that was left was a trip to the pub to relax after a good day’s work! :D

Thanks and kisses

I thank Tom for being a fantastic co-facilitator, and Chris for doing an excellent job of organising everything: food, refreshments, sponsorship, venue, my hotel last night, and probably a whole lot more that went so smoothly it was unnoticed.

Thank you very much indeed to the sponsors and supporters: epiGenesys, University of Sheffield Enterprise, O’Reilly UK and The GIST Foundation. It would have not been nearly as awesome without your help.

Thanks to all the people around the world who talked to us over Skype – it was great to feel part of something so much bigger than just us.

Thank you so very much to everybody who participated today. You really made it a great day for everyone.


Code Retreat in Winchester

All day today there was a Code Retreat at Eden Development. About 20 people came, from all over the country, and we spent an excellent Saturday pair programming together, sharing ideas, having stimulating conversations and getting to know each other much better.

At a code retreat everybody works on a single problem: Conway’s Game of Life. You pair with different people in each 45 minute session. You have to TDD the development, but you can use whichever programming language you choose as a pair. At the end of each session all the code must be deleted. You do a retrospective as a group, have a little break, then go and pair with somebody else.

We got through 6 sessions, which means i pair programmed with 6 people i didn’t know very well before today. It was great! The first two sessions i paired with Paul and then Quentin. To start with, we were pretty much feeling our way through the problem, implementing the rules of the game, and then getting stuck with determining the position of each cell.

In the third session i paired with Ben and we decided to try a completely different approach: dealing purely with coordinates to represent the positions of live cells. It actually worked quite nicely, although implementing the rule logic became quite difficult.

After lunch we were invited to try “TDD as if you mean it” which has very strict rules about where and when you should create your code, and when you can move it. It’s quite restricting the rules seemed to hold us back from getting very far. I was with Louis that time, who was very good at helping me to program in Java, which i’m not so familiar with.

At the 5th session we were allowed to just do whatever we want, so long as it was still test driven. I paired with Paweł and we just went a bit wild with linking cells to each other and getting them to link back respectively. We were going with North, South, East, West, but we eventually realised that you could really link any cell to any other, and the direction doesn’t matter. At that point it becomes more of a network problem. You could say that as a software coder i live or die depending on the community and people i know. That was an interesting insight.

In the final session I was with Clive and it turned out to be our best session of all. We were extremely controlled in our TDD, making sure we understood the code at each stage, and only taking small steps, and predicting at each test run whether it would pass or fail and what the failure message would be. We had cells that knew their positions, and could receive other cells and decide whether or not to attach to them as neighbours. Meaning we could pass every cell to every other cell and get them to connect based on their positions, then we could count how many neighbours they each have.

I mostly programmed in Ruby today, but there were people coding in Java, C++, C#, Python, and i think Scala, Clojure and PHP. We learnt a lot about how to program the game of life, and more importantly, how not to! A code retreat is a great opportunity to have fun, get to know other people, and code in an environment where it’s safe to try things out and make mistakes.

To find a code retreat near you, look on coderetreat.com or consider running your own!

Learn to Type – Day 4

I had a day off work today, so i’ve only just come to do my 5-minute test just now. 88wpm, hands covered, not so good as yesterday, but i am really tired at the end of a lovely exciting day.

I think i’ll go do a few powertyping exercises, followed by a few rounds of typeracer. In the meantime, enjoy this video that Enrique made: it’s me and Tom playing typeracer yesterday lunchtime!

Type Racers from Enrique Comba Riepenhausen

I scored 102 words per minute, at 100% accuracy!!

Learn to Type – Day 3

Wow, my 5-minute baseline test this morning was much better than the previous two days: 91 words per minute, hands covered. I got to the end of the story of the Foolish Frogs, and had to start again at the beginning!

Corey has encouraged us to set a goal for the end of the week. I will make it my goal to get to 100wpm on the 5-minute test. I feel that this should easily be possible by going at the speed that i am currently doing, but removing all the mistakes. This morning i managed the first minute without a single mistake, but the mistakes started to creep in after that. On my typeracer games i have noticed that a mistake costs a significant amount of time. It’s more effective to go a bit slower and think more, rather than rush ahead and make a mistake.

In my practice time I am continuing to learn to touch type numbers and symbols. I’ve found it very satisfying, just a single run through a lesson on PowerTyping.com is enough to set it into my head where a few more symbol characters are. The real test comes when i’m programming: can i find the parentheses when i need them? Curly braces? Where is that hash key? Do i need the shift key or the alt key, and can i find it without looking?

I didn’t do many rounds of typeracer yesterday, so i want to do a few more today. My fastest yet has been 109wpm but i’d like to push that up to 120wpm. Two words a second, consistently … that would be so awesome!

There have been some interesting conversations just lately about whether or not you have to touch type to be an effective programmer. Of course, you don’t, and i think we would be unwise to apply the sort of value judgements that imply any sort of eliteness or inferiority between those who touch type and those who don’t. The key word here is effectiveness. I recognise that many people are able to program very effectively without touch typing.

However, i believe there is always opportunity to get better at what we do. The questions to ask yourself are whether you feel you could be more effective at typing, and do you want to learn? With the tools we currently have, i believe the keyboard is the best interface between our brain and the computer, so it makes sense to use it to the best of our ability.

Oh my gosh, Frances has just made the most amazing double espresso EVER!! <3

Learn to Type – Day 2

Ahh, yesterday was good. I did some exercises on powertyping.com particularly the numbers and symbols, which is what i’m especially trying to practise this week.

I was delighted last night when i managed to complete one round of typeracer at 99 words per minute with 100% accuracy! That is something for me to be very proud of! Now if i can just get to that accuracy and speed consistently, i will be very happy!

This morning i’ve done my hands-covered 5-minute test at FreeTypingGame.net and scored 76 words per minute, slightly slower than yesterday’s 78. I made more mistakes, particularly with quotation marks and exclamation marks.

Other resources we have discovered:
TypingWeb.com – typing lessons that save your progress. (only Qwerty)
aTypeTrainer4Mac – a Mac program to download and use offline.

Learn to Type Correctly Week

The week has begun! Developers all around the world are making a conscientious effort to learn to type faster, more accurately, more effectively.

This is thanks to Corey Haines proposing a Learn To Type Week! Today we have been given our first instructions for Day 1: do a 1-minute, 3-minute or 5-minute exercise from FreeTypingGame.net with your hands covered over so you can’t peek.

I did the 5-minute test, writing the story of the Elves and the Shoemaker. I made a few mistakes, but i felt quite a smooth rhythm. I got 78 words per minute. That’s not too bad; it’s a nice baseline, something to build upon. In some of my typeracer games i’ve sometimes been getting to 100+ words per minute, so i’d love to be able to get there comfortably and consistently.

One thing i’m really trying to focus on this week is the number keys and symbols. I can touch type letters (on Dvorak keyboard layout) but when it comes to symbols i always have to look. I also need to learn once and for all to use both shift keys and not always to go to the shift key on the left.

Have a good week everybody! :)

760th day at Eden

We have a new intern at Eden. Tom Crayford studies Software Engineering at Sheffield University and is doing a 2&frac12; month internship with us, with the possibility of becoming an apprentice at the end of it.

In the style of Tom’s two recent blog posts, First day at Eden and Second day at Eden i thought i might also write about my day, since it was a particularly satisfying one. It just so happens to be two years and a month (760 days) since i joined Eden!

Straight after this morning’s stand-up meeting, I had a quick debrief of a meeting we had with a potential new client yesterday evening. Then i helped Todd to write an email. We draft our emails on Google Wave these days, which is often fun. Four of us were editing the email at once, which means we quickly get to something we’re all happy with before sending it.

I went out for a walk with Frances to pay in some cheques and buy some Friday Treats for everyone!

At lunch time some of us had several rounds of TypeRacer in preparation for Learn To Type Correctly Week next week! I think it’s incredible how so many people have got enthusiastic about learning to type well after Corey Haines announced it. If you don’t believe me, check the twitter hashtag, #learn2typewk!

Something quite unusual happened after lunch. We had a message from Richard Knoll at Mercia Cycling Club in trouble and needing help because the site was not responding. Richard had found us on Google after searching for Ruby on Rails. I agreed to look at it with Tom for an hour and see if we could figure out what was wrong. We determined that rubygems and Radiant had been upgraded on the server and we needed to tweak a few configuration files. With help from Chris and Spencer, the site was back within the hour! Chris then helped me to raise an invoice for an hour’s work.

It’s interesting that we can do anything from a fast restore of an unresponsive website, to projects that take several months from start to finish, requiring two or three pairs of developers working at a time.

Tom and i continued to pair together for the rest of the afternoon. We were able to add value to a project to help a charity in Cambodia. I always learn something whenever i pair with someone. Tom is no exception and i very much enjoyed pairing together today. We all have things we can teach each other.

Tonight i think i might learn a bit from the Ruby Kōans, possibly study a bit of SICP, and definitely see who gets evicted from Big Brother!

Design Patterns study group

A new thing at Eden is we have started a study group and we are currently studying the Gang of Four Design Patterns book. I’ve read this before but i’ve not studied it. I guess i got an overview and thought to myself, “Well, i know where to look if i ever want to look up a pattern …” – Have i ever looked up a pattern since? No! ;)

So i’m really glad to be studying it this time and really getting to know the patterns properly so that i can use them readily whenever appropriate. It’s good to have the opportunity to discuss one pattern at a time in a group. Here’s a photo from the first study group last week:

Design Patterns Study Group

As part of my studying, i am implementing examples of the patterns in Ruby. Last week i coded the Factory Method example. It’s funny how i can skim over the code in the book and convince myself that i understand it, but coming to implement it for myself in a different language was a challenge. One that i thoroughly enjoyed, i have to say! :) I’m happy to say that i now fully understand the factory method!

I’ve also been writing tests to ensure the code works as i expect. This has been useful because i’ve learned about Test::Unit which was previously unknown to me. When i joined Eden i learned RSpec and Cucumber (or story_runner or whatever it was called back then). Other than that i’d never tested Ruby before.

This week i have been implementing sorting algorithms as strategies. I wasn’t too impressed with the code examples in the book for the Strategy pattern, largely because they left out all the code that actually differs between the strategies! So i decided to make up my own example. It has been good to refresh my memory on sorting algorithms at the same time as clarifying how the Strategy pattern works.

You can follow along with my workings on sermoa/ruby_design_patterns.

Practice makes perfect

I have recently been struck with the idea of practising coding skills. It makes so much sense. In this video, Corey Haines talks about the necessity of practice, and likens it to learning a guitar. You don’t just play a song right through first time, and then move on to another. You need to spend time practising the chords, and changing between them.

Road Thoughts – Practice from Corey Haines on Vimeo

In the same way, as programmers we need to sharpen our skills by doing little practices (sometimes called katas from the Japanese word 型 meaning ‘form’) and repeating them over and over until we get them just right. The skills we learn during practice will be ready to use when we need them in a real project.

The atmosphere at Eden has changed recently as people are taking it upon themselves to learn new skills and practise katas. Suddenly we’re all looking at each other and thinking “I don’t want to be left behind!”. Just as Uncle Bob said yesterday:

You raise the level of professionalism in your company by raising yourself. Refuse to stay where everyone else is.

– @unclebobmartin

That said, i still find it very hard to motivate myself into actually doing some practising! There’s always so much ELSE to do, right?! I love the idea, but i need a bit of a push getting started. I need a mentor to guide me.

I have forked coreyhaines / practice_game_of_life on github and got as far as running the cucumber specs. At the moment i’m not really sure what to do next but i’m mulling it over and will hopefully make a start on coding something this week. I’ll probably completely mess it up a few times and have to start again, but hey, i’ll learn a lot from it! That’s the whole point of practising, isn’t it!

I will update here to let you know how i get on! :)