Global Day of Code Retreat 2014

    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 dif­fer­ences from the other ones was that it was more mul­ti­cul­tur­al. 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.

    I didn't see many .NET developers here, unlike Cluj, but Java was also one of the dominant languages, but it seemed to me that there were enough other exotic languages like Go, Javascript, PHP, Scala and Python to make it more varied.

    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.

    The third one was with Lukasz and Greg. We were three because there was an odd number of people at the event, so there was always someone who had to make a bigger team. We did Javascript and half the time was spent discussing various idio­syn­cra­cies of Javascript

    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 con­straints 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 re­quire­ment: 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 em­barass­ing 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 con­straints 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 in­ter­est­ing here and I heard of some in­ter­est­ing concepts about different kinds of poly­mor­phism. 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 mod­i­fi­ca­tions 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 in­cor­rect­ly 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 im­ple­men­ta­tions that were done there was in SQL, with recursive queries and other magic stuff. That guy pretty much won the day. De­clar­a­tive 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