This week I’ve been in the UK for europython. 440 pythonistas gathered in Birmingham, not just for the three day programme of talks, but also for two days of tutorials and up to a week of ”sprinting”*. I was there together with my husband, Geoff, and we were leading rather more sessions at it than was really comfortable – two tutorials and three talks.

On Sunday we led a tutorial on TextTest together. It seemed to go ok, although the hands on exercise we had set turned out to be far to hard. Something to improve for next time.

On Monday I led a coder’s dojo which was very well attended. One of the participants actually said afterwards that watching my prepared Kata demonstration of KataMinesweeper was one of the highlights of the conference for him. I’m looking forward to starting this new dojo – JDojo@Gbg - after the summer, which should be a chance to introduce more programmers to the art of Test Driven Development.

On Tuesday the actual conference proper started. I attended a whole track on testing tools and approaches, which was brilliant. Five years ago at europython they managed four half hour presentations on testing, and this year we had enough talks for a day and a half by my reckoning. The python community is catching on.

One of the highlights of the conference for me was meeting up with testing tool creators and discussing in depth the challenges and experiences that have shaped them. I met Pekka Klärck briefly at XP2009 a few weeks ago, and it was great to see him at europython too. He is the creator of the Robot Framework,  an acceptance test framework implemented in python but able to test code written in many languages, just like Texttest. He also saved Geoff’s bacon when Geoff’s laptop completely died and refused to restart 5 minutes before he was due to give his demonstration of texttest. Pekka kindly lent Geoff his laptop, and let him install texttest on it. The demo went remarkably smoothly, considering, although navigating ubuntu in Finnish was a little challenging…

Geoff, Pekka and I also spent some time chatting with Holger Krekel, who has created py.test, a more pythonic alternative to the standard python xUnit implementation. He’s just releasing the 1.0 version, after many years of development and active use, and I for one intend to switch over to it. It feels a bit like JUnit 4, making it easy to write tests without a lot of boilerplate or needing to inherit from TestCase.

There were several keynotes at the conference, but I think the best one was by Bruce Eckel. He wrote the bestselling ”Thinking in C++”, ”Thinking in Java”, and also numerous articles.  I think he is unusually well qualified to compare some of the language feature choices made in C, C++, Java, Python and Ruby, as he did in this talk. Maybe it was because he was speaking at a python conference, but it seemed clear he prefers python to the others. In fact, although he was calm, rational and well informed when criticising Java, I felt he wasn’t managing to hide his bitter anger and frustration with that language.

On Wednesday, I wrote some notes about stuff in my personal blog.

On Thursday, I led a session called ”the clean code challenge”. My aim was to spark some debate on this subject, which anyone who came to my clean code talk at ScanDev or has seen this will know is close to my heart. After some introductory slides on the subject, I showed Bob Martin’s Args program that he has published a full worked solution to in his book ”clean code”. I explained that since Bob Martin, a famous Java programmer, had published this code as an example of what he thinks ”clean” looks like in Java, maybe we could use it as a starting point when discussing what ”clean” code looks like in python. I had translated this code into python, preserving as much of the Java structure as possible. (Both implementations available here).

Just putting the code up on the projector gave rise to some acidic comments about Java and its wordyness. It might have been good in Java, but it is pretty terrible python. One guy got quite worked up, and complained that this was a completely flawed way to create clean code in python, and stormed out.  (He later apologised to me). Thankfully most of the others stayed, and helped me with my ”challenge”. I asked people to look at Bob Martin’s code, and my translation of it, and to either refactor it until it was good python, or to start over from scratch and reimplement it pythonically.

After about an hour of coding, we held a discussion about what we had learnt. The feeling was that the code was quite hard to refactor, since it was so steeped in the Java idiom, and took an approach that was so unnecessarily complex in python. We discussed a whole range of things to do instead, some taking advantage of language features like metaprogramming that Java lacks. Someone pointed out though, that a lot of the things we were proposing were perfectly possibly in Java too, just unusual in that language. So I now feel challenged to go away and reimplement the problem in Java, using pythonic idiom :-) I’ll let you know how I get on.

All in all it was a great conference which I thorougly enjoyed, although I am completely exhausted now.

* ”sprinting” is a phenomenon where distributed open source projects arrange for all the core developers (who will generally already be planning to attend the conference) to spend a week before or afterwards working full time on the project, co-located. This means the project makes rapid progress, and benefits from improved collaboration once everyone returns home.