19 October 2013

Awesome Week 6

Leave 80cm SpaceJourneyman Tip: Plan for some space each month
I try to keep the pairing sessions of my Journeyman tour free of any appointments. If we spend only two or three days I do not feel comfortable in coming late or leaving early, there is just not enough time. My calendar was blocked by pairing sessions entirely until my first "free" day last week. It was a busy day, and I used it to prepare a few things for our upcoming Eclipse DemoCamp in Vienna. And I had a job interview. (The position looked cool but in the end it turned out the vacancy was not for a developer but for a Unix sys-admin guru, someone who compiles his own kernel for fun now and then.) They day was too full, I had packed too much into it. So I recommend leaving one or two days without any pairing session each month, to catch up with all the things that need to be done. Corey did the same thing, splitting his journey into tours of up to four weeks, and also Daniel Temme ended his Journeyman weeks after four weeks.

Week Number Six
The remaining days of the last week I visited SIB Visions, a company focusing on the simplification of the software landscape used to support business processes. The backbone of their application stack is the JVx Enterprise Application Framework which was open source right from the start. If you need to build a typical business application to edit data in table- or master-detail-style, this is the framework you want to use. Check it out!

First I paired with René Jahn, SIB Visions' Head of R&D. He had a list of things he wanted to discuss with me. We started with the build. I complained that it was too slow, running longer than a hour, and that there were failing tests. We immediately started fixing them. Then René showed me the framework and I was impressed. The JVx code-base is following a strict standard defined by René, covering documentation, naming and much more. While I did not agree to some of his conventions I did admire the consistency in the code base. I believe that consistency is crucial for quality of a code base, some time ago I even declared it the First Law of Code Quality. Well done JVx team, I like that ;-)

Then I worked with Martin Handsteiner, CTO of SIB Visions, on a particular tricky problem. A main class of JVx' data model had grown larger than 5000 lines and needed to be split. Due to performance optimizations it worked with plain object arrays internally, following the Flyweight Design Pattern, which did not make it easier to understand. We fought the beast for two days and were able to split away a few hundred lines of code. It was hard work, but just the beginning of a longer rework Martin had estimated to take two weeks. It should never have become that large and entangled in the first place. Martin had always wished for a keyboarder/keyboardist and a "mouser" and thus stayed in the navigator role for most of the time. While it was unusual for me to be the driver for extended periods of time, it worked out well because Martin knew the concept of his model and I was moving forward relentlessly.

Caps-Lock is FULL OF AWESOME!!1!Just yesterday I received mail from René telling me that his build now takes nine minutes, 900% faster than last week and that all tests are green. I was delighted. For the first time one of my hosts had taken my ramblings serious and immediately fixed the issues. Awesome, that is the right spirit. Keep up the good work!

Remote Pair Programming
Even more awesomeness happened at the weekend. My friend Thomas Sundberg asked me for help with his presentation on (Remote) Pair Programming at 33rd Degree for charity in Kraków, Poland. He needed a remote pairing partner for a small demo. We frequently do remote pair programming katas since more than a year and were sure we could pull it off. During lunch break we tested connectivity and the audio equipment of the conference venue, to make sure that everybody would hear me. During the demo we did a few cycles of TDD, discussing names and refactoring the code in ping-pong style as usual. I was sitting at home, still contributing to a conference talk - it was awesome!

12 October 2013

CodeCopTour Weeks 4 and 5

Today The day I started writing this post was the first day since more than five weeks that I did not schedule any pairing session. Somehow the day stayed blank in my calendar. Still it was a busy day. I spent more than four hours on emails, preparing stuff for our upcoming Eclipse DemoCamp and in the evening I attended an user group meeting. There was just enough time to squeeze in a blog post about the last two weeks, the fourth and fifth week of my CodeCopTour. Both weeks I visited a larger IT service provider. As I tweeted earlier this company wanted to stay anonymous for reasons I will explain later, so lets just name it Reynholm Industries. When planning my tour I had aimed for sessions of two or three days with each host but the management of Reynholm had invited me for two full weeks to visit several teams and pair with different people. I agreed and they had prepared for my visit three months in advance, at least that was what I thought.

Legal Issues
Obviously Reynholm was large enough to employ one or more legal advisers and they were afraid. I would work for Reynholm for two weeks and would not get any money. Nobody would believe that, so Reynholm might be accused of employing me without paying taxes. Austria has mandatory social insurance and its institution is lacking money and tracking down all possible cases of black market work to collect their share of the salary. In the morning after I arrived I was brought to the legal adviser and he told me that we had to cancel my visit. After preparing my visit for three months he had started his work one day before the deadline, my arrival. I was not amused and in no mood to drive back two hours with my business here unfinished. It took us half a day to work something out. In the end I signed a contract, accepting the responsibility to pay taxes for my income as necessary and I paid for the hotel and food myself. The fee of the contract was exactly the amount of money Reynholm had planned for my expenses, which was pretty accurate. I hope that in the end I will get back all the money I spent. Working on a contract and spending all income on expenses also does not sound reasonable, and I hope I will not get in trouble with the tax office.

First Code Retreat in Graz
Being in the area of Graz I used the opportunity to meet with my friend Wolfgang Kaufmann. Before I arrived I had talked to him about running a Code Retreat in Graz and he immediately agreed. He brought in some of his colleagues to help us organize and even talked his employer INFONOVA into sponsoring the coffee and lunch during the event. The local university FH Campus02 let us use one of its lecture rooms and we were ready to get started.

Code Retreat Graz, Session in ProgressAfter morning coffee I introduced the participants to the idea of Code Retreat and we started practising TDD, pair programming and object orientation.

Code Retreat Graz, Buffet by INFONOVADuring the first session almost all teams used arrays of integers or boolean flags so I chose No Naked Primitives as constraint for the second session. During that session only one pair worked on the business rules and all others created only infrastructure, so I proposed to focus on the domain in the next session. Lunch was great, we had wine and beer, several main dishes, even cheese and sweets. It was luxuriant - thank you INFONOVA. (I know I already mentioned them, but the lunch was really awesome, so one extra link will not hurt. Did I mention that they are looking for all kind of developers, just check out their web site ;-)

After lunch we had a session of Ping Pong Mute, which was really fun. One participant complained that he could not go for a design he wanted to try because his pair would not understand it without long explanations. I liked the idea of measuring a design by its simplicity - by its ability to be understood without much discussion. Probably his idea did not follow the KISS principle. After another round I asked the audience what they would like to work on in their last session and Wolfgang proposed No Conditionals. Although this is one of the more difficult exercises they came up with great solutions using nested maps or state machines.

Code Retreat Graz, Closing RoundIt was a very nice Code Retreat. The 15 participants were a good mixture of junior and senior developers, Scrum Masters and even one Product Owner who wanted to know what "his" developers do in their personal time ;-) People learned a lot, many of them had their first contact with TDD and pair programming in practice. Several decided to give TDD a try in their daily work. Thanks to our awesome sponsors INFONOVA and Campus02 we had everything we needed and the attending developers used the opportunity and made it a great event. Thank you all!

Second Week
In the second week I continued my journey through different teams at Reynholm and paired with different people for a day. All developers I met were friendly and open and I had a lot of interesting discussions. I already knew many people from the previous week and kept meeting known faces in the hallways and during lunch. At the end of the second week I felt like I had been with Reynholm for a long time and I even felt a bit sad I had to go away now because the people were so awesome. Thank you Alexander, Andreas, Andreas, Bernhard, Harald, Karl, Martin, Peter, Robert, Sabine, Stefan, Tom and Wolfgang. I will miss you.

27 September 2013

CodeCopTour Week 3

I was waiting for the legal advisor of TechTalk to review the five lines I wrote about my visit at their office the week before, which caused some delay in my blogging queue, but now I am back on track and will continue with week number three of my tour. I started the week with going to the country-side of Lower Austria. While driving I reflected about my tour (and I already published my thoughts here). Markus Schinerl had invited me to stay at his house for three days. Markus runs a small company called sdguide.org which is specialized in calculating metrics like the carbon footprint for factories in the pulp and paper industry. Pulp and paper is a very competitive industry and customers like governments demand the highest environment-conserving certificates from their paper providers. Sdguide's office was located in an old house and due to old age and structural damage it was under construction and looked terrible, see the image on the right side. Some windows were broken and we worked on a raw, wooden construction resembling a table. However we had a powerful computer, two keyboards and two huge screens - no problem there ;-)

Spreadsheet Monstrosities
The Sdguide OfficeMarkus used a gigantic spreadsheet to enter all parameters needed for such a calculation. It contained roughly 200 input parameters and 500 metrics for up to 50 product parts resulting in huge files with thousand of lines. Obviously Excel was reaching its limits and he needed something more powerful. We spent the first day discussing the domain of carbon footprint and created a small diagram defining the core elements of his calculations. Although we did not write any code it was a productive day because I helped Markus to reflect on his needs and he explained the requirement to me at the same time. We came to the shared conclusion that he needed a real database, but one that he might be able to develop himself, so we ended with Visual Basic (for Applications aka VBA) and MS Access. Although I did not fancy VBA it was the best choice for his needs and he liked the idea that he would be able to use parts of our VBA code in his spreadsheets as well.

Markus had used VBA some years ago and I had never worked with it before. It took us half of a day googling and reading StackOverflow until we got fluent and then we flew. VBA does not offer much and I missed a lot like unit testing, collection classes, closures and much more, still we made good progress. At the end of the second day, actually the very end of the day - it was 10pm, we had built full end-to-end functionality. Of course it was not finished and only calculated one simple formula of one metric for one product part without considering scenarios, different years or different customers. Still it showed the way. I had aimed for that because we needed to know if the chosen design would work. It looked good. During the third day we added more features Markus wanted to investigate, we even created an infix math parser to evaluate arbitrary formulas. It was great and I learned a lot.

Being Brutal
Back in Vienna I helped a small team of developers to improve their refactoring skills. The developers liked practice and I chose Adrian Bolboaca's Brutal Refactoring Game. I had participated in Adrian's session during XP2013 earlier this year and had liked it a lot. It is a programming challenge focusing on refactoring. The brutal part is that each code smell needs to be refactored right now, regardless how small it is. This makes an excellent exercise to train developers in spotting code smells and refactoring them. Adrian lists 17 code smells as the base of the game and I asked the team to prepare short presentations about each of them. At the beginning of the session the developers presented the material to the audience. I just love when trainees teach themselves ;-) During the sessions I collected all the smells I had flagged. Half of them was about naming, i.e. "name not from domain" and "name not revealing intent" which did not surprise me because naming is a difficult problem. Further 30% were "Primitive Obsession" and "lack of tests", common problems in most code bases. One participant was disappointed that he did not hit each of the 17 smells at some point during the game - maybe I will add some game like achievements for completionists like him.

Even for a small group it was demanding to watch out for the smallest code smell in several evolving code bases at the same time. I noticed that pairs kept hitting the same smells again and again. Besides naming, which all participants had to deal with, one pair was "obsessed with primitives" several times, whereas another team had trouble writing tests to cover their design ideas. A fast typing pair, two developers who knew their IDEs well, created a lot of code, but as soon as I found a smell they were unable to remove it by refactoring and had to delete the new code and start over. Although I was as brutal as possible and challenged the participants a lot, I got positive feedback after the exercise and all participants learned something.

Too Much CoffeeThe Java User Groups of Austria
For the rest of the week I went "on tour" with the Java Klassentreffen 2013. The Klassentreffen is a series of events organized by the Austrian Java training company Ciit and sponsored by Oracle. It is a mixture of sales pitches and technical presentations, covering various aspects of Java. Technically the Klassentreffen did not meet my requirements for the pair programming tour, but the organizers had invited me to speak and food was provided. Together with Martin Ahrer, the founder of the eJUG Austria, I introduced the audience to Java and Java related user groups in Austria. I started my talk with the reasons to attend user groups, then covered the core groups of Java, Eclipse, Android and Scala and finished the presentation with Open Source, Software Craftsmanship and upcoming Code Retreats. (For details and links please open the slides.) Later the leaders of several groups told me about new registrations, so I guess my presentation was a full success.