Global Day of Code Retreat 2014
I have already been to three Code Retreats in Cluj and I have always enjoyed them. Now I had the chance to go to one in Zurich.
This one was just as much fun as the previous ones, maybe even a bit more. One of the biggest differences from the other ones was that it was more multicultural. While German speaking people were the majority, there were plenty of people from other countries: Russia, Bulgaria, Poland, Sweden, Hungary, Britain. It's always fun to meet new like-minded people from all over the world. There was even a guy who had worked at the LHC in Geneva.
The first session was with Arild and we did Haskell. He had used it at university, I read the Learn you Haskell for a Greater Good, but neither of us was exactly super strong in the language. Because of this, almost half the time was spent on getting QuickCheck to work, but we gave up on it and in the end we switched to HUnit when figuring out the properties of our functions became too difficult.
The second session was with Dominik, also Haskell. We got a bit further, but not too far, the testing was still quite slow.
After a lunch, I did Python with Pascal (I think, I'm not sure about the name, sorry). The twist here was that initially we were told that there are no constraints and that we should just try to make the program as soon as possible. Then, halfway through the session, one of the partners in each team was called out, while the other one continued coding. When they came back, another person came to your team, who was supposed to be more critical and insistent on clean coding and they would also bring a new design requirement: cells die after 10 ticks. In my team the new member was Thorben. He had a few comments about my Python code and I had an embarassing bug because I forgot that for sets I have to override hash not __eq__, but in the end we managed to get it to work.
Every year I do a session where I try to code in Python in a non-idiomatic way, with too many Object Oriented design patterns. This year it was with Klauss. The constraints this time were up to use to choose, ranging from no arrays, no primitives, no ifs, no loops and no mutation. We decided to go all in. It was very interesting here and I heard of some interesting concepts about different kinds of polymorphism. I didn't fully understand them and it's unlikely I will apply them anytime soon, but it's always nice to understand a bit more about designing layers and the kinds of problems it solves.
The last session was with Michael and it was fun, though we cheated a bit. The constraint was that the world was a hexagonal grid. We decided with Michael to reuse the previous code and just focus on modifiying it so that the neighbours are returned correctly and that the console UI looks correct. We drew about 10 hexagonal grids of size 4x4 on paper. The actual code modifications were done in 10 minutes, the rest of the time was spent debugging. After about 30 minutes we realized that we had got it wrong on paper, we calculated incorrectly what would survived to the next generation and that the code was correct all along. Except that the UI was rotated and mirrored, so we had to turn the laptop for it to match our drawings :D
One of the coolest implementations that were done there was in SQL, with recursive queries and other magic stuff. That guy pretty much won the day. Declarative all the way.
Geza, the organizer, said that he is planning to do Code Retreats in other formats, such as cleaning up legacy code. Can't wait for those :D