Hello everybody.
So yesterday I was on a little gathering called Coderetreat.
If you look at the link you can read everything about it. If not, I’ve provided a short description.
What it is about?
So what is codereatreat about? In short it’s about programmers getting together and honing and practicing there skills in order to become more at what they are doing. It’s a practice run with great people. TDDing one problem the whole day long with constantly applied constraints.
Problem domain
Usually it’s some kind of coding kata. This sessions problem was Convey’s Game Of Life. It’s a well known problem which you can’t really solve in the given amount of time if you do it right. But that’s not the goal anyways. The goal is the journey itself as was formulated by our facilitator.
Process
So what was going on there anyways? At 10:00AM the whole thing begun. Thirty developers set down, choose partners for TDD, and started to tackle the problem at hand. There were 6 sessions which lasted 45 minutes. After that a short retro and then a 10 minute break. On every session the code was deleted and rewrote from scratch. The first two sessions were introduction. And then the fun started with the constraints.
Constraints
The first one was that we were not allowed to use any loops when solving the problem. That was a tricky one. You had several options to go on but me not being a proper developer I couldn’t think of too many. Well that’s why I was there wasn’t I? To learn. I came up with the idea of linking the cells together so when one is invalidated it notifies all his neighbours through a call. But I wasn’t sure how to implement it. Also I choose a group which worked in ruby and it was a long time ago I wrote something in that language. It was a group effort but eventually we came up with a prototype that proved the first rule. I was happy!
The second one was TDD ping pong. That was a really interesting experience for me. I grouped with a guy who had already experience in code retreat session so he didn’t spare me. In addition we did silent ping pong and it was HARD! It was really hard for me to formulate my thoughts JUST in tests. So that he can get what I want and understand and agree on the design at the same time. So we ended up throwing tests at each other with the thought: Here try to solve this you bastard! It was great fun indeed!
The third constraint was ‘No conditions.’. That was the hardest for me. Coming up with recursion for the first one and having a fight in the second was nothing compared to this. Conditions are a fundamental structure of programming. It’s logic basically. You can have the cells as objects and then a world of cells linked together but you still have to somehow decide if they live or die based on neighbour count.
So how do you avert it? I worked with a guy in this one who was good at low level thinking. He came up with the solution of using expressions as returns for the status:
return (!((neighbours < 2) || (neighbours > 3))) || (((neighbours == 2) || (neighbours == 3)));
It’s brilliant and easy if you see it like this but I was so used to thinking in higher structure and so used to the features given by the language, that I couldn’t have come up with this in the given amount of time. So he had the idea and I coded it down. And this is actually working. It returns true or false based on the neighbour count. And we could use that return value to change the state of the cell afterwords.
The fourth and last task was that everybody stand up and finish someones else code. Practicing how to handle “legacy” code and a free for all session to finish the job.
What I learned?
Basically I learned that I really like code. I like writing it, thinking about it, solving problems and creating good, clean, clever solutions. I might be a tester by profession and I love being a tester, but there is a coder somewhere in here too who enjoyed every bit of that session yesterday. Of course this is not the only thing I took from that. I learned good technics. I learned that I’m in a box and I need to think outside of it too. I constraint myself by depending on the language I use. And that I need to keep up practicing alas I loose my ability to solve complex logical problems by coding.
A coding kata a day helps keeping the bugs away. 😉
End thoughts
All in all the day was absolutely awesome. Great lunch and environment was provided by the host Camelot and our fearless leader who walked around all day helping out and coordinating the whole thing Marton ‘Meza’ Meszaros. A big thank you and a lot of respect for doing it all day long.
Unfortunately because of my broken ankle I couldn’t stay for the drinks but if you ever get to a session like this I strongly recommend staying the whole day AND the night. And not just ’till you stuffed your belly with free food and booze. 😉
And the top of the cherry is a great time laps of the whole day which can be seen here: Coderetreat 29.09.12. Enjoy as we had!
As always,
Thanks for reading.
Gergely.