Rediscovering the joys of coding

Just a bit too early
Ever got up at 7am on a Saturday to spend your day coding, really? Yeah, I did just that last weekend. I arrived a little after 8 am and there were already a lot of people there, enjoying the ‘koffiekoeken’ breakfast. Most of them looked like they were thinking the same thing as me: “This is damn early for a Saturday. This better be good.” I had a short chat with some of the others, welcoming them to this first #coderetreat. Not long after that @CoreyHaines suggested we’d better get started since it was going to be a tight schedule.

The setup
I did the formal welcome word for this first Belgian edition of the #coderetreat which consisted of thanking everyone for showing up and wishing everyone an inspiring day of coding. I was really surprised to see that many C# developers in the group, I hadn’t expected that. Then Corey took over and introduced us to the concept of the #coderetreat. We were going to try and solve the mystery of “The game of life” in a time box of 45 minutes. He assured us that we had no chance whatsoever of finishing our ‘solution’. That wasn’t the point anyway. The focus for that day was to write beautiful code, even if it was only 10 lines of code. These 10 lines had to be the highlight of our coding career. Oh yeah, I almost forgot, after the time box of 45 minutes we had to delete all our code. My mind went like: “Did he really just say that? We have to throw it all out? Everything we worked on this entire day was going to be deleted after each session?” And I wasn’t the only one who had some difficulty with that rule. You spend 45 minutes in deep concentration. Working together with our pair to come up with the most beautiful code ever written and then you have to delete it.

Session number 1-2-3
So I started of the first session trying to do ruby on my pair’s laptop, but his system froze after a couple of minutes. So we had to switch to C# on my machine. I was a bit disappointed because I was really curious about this whole ruby thing. It felt like about 10 minutes later Corey gave us the signal that the session had ended. We weren’t even close to a working solution. We only got some basic building blocks. We didn’t even get to the rules of the game. Most people had a hard time deleting their code, but did it anyway.
In session 2 and 3 during the morning I paired up with some different people and we started to change our point of view. Instead of starting with creating the building blocks, why not start way up high with the rules. We’ll see the building blocks evolve from there. And it actually worked way better that way. We shouldn’t be focusing on building a domain model first, which was what we had been doing in the first session. We should be focusing on the behavior of our game and get to the bottom when the need arises. I finally got the opportunity to pair up with a ruby developer and man was I surprised. Without a fancy IDE, without setting up a lot of stuff, we went straight into writing test cases, mocks and definitions of objects we were going to need for our test cases. It really feels like retro coding when in fact it is a new evolution in the way we write code. I really liked the ruby experience, so I’m going to look into that a bit further soon.

The brains needed energy
So we went for lunch after an exhilarating morning of coding like hell. We had a long lunch break, about an hour and a half. Corey insisted on this because of the work we were doing. We really needed that break to replenish our energy and to get the chance to talk to people. So we ended up talking about a lot of different subjects. Some were off topic, talking about the weather, the states and cultural differences between the countries Corey had visited during his world tour. We did of course touch some on topic stuff as well. We talked about how deleting our code actually started to feel like a relief. We didn’t have to carry it on to our next session. We could start each session with a clean slate, not worrying about the crappy code we just wrote during the previous session. It had a real liberating effect. We talked about ruby and how it is a completely different experience as the more traditional languages like C# (mental note: I really need to make some time to study some ruby).

Back to the problem at hand
In the afternoon, our approach and the way we wrote our first lines of code changed dramatically. We really started to get into the problem domain and experiment with new ways of looking at the problem. Writing test cases, writing the simplest code to pass these tests and then refactoring on green, that was the way to go. Nobody really got close to a solution, but nobody cared. We finally got to experience the joy of coding again, something that most of us had forgotten. I never saw so many happy programmers in one room. The whole setup was so inspiring. For our last session we got an extra half an hour, but even then we couldn’t finish it and nobody felt bad about it by this time.

Looking back
After the last session around 5 pm we did a round table retrospective. Most people learned that they weren’t as great as they thought and they had a lot to learn about TDD and writing beautiful code. Most of the C# and Java people said they were definitely going to look into this ruby stuff. All in all it was an awesome day and most attendants were already looking forward to the next edition in January, we’ll keep you informed.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s