27 October 2013

CodeCopTour Week 7

I think it would speed things up if I cover two weeks of my Pair Programming Tour in one swoop, as I did two weeks ago. I want to share some insights besides the usual diary, so I need to increase my writing throughput. On the other hand I do not like going faster because writing a blog post takes as long as it takes. Although I know people who do speed blogging, the OCD part of my personality does not like short-cuts, obviously.

Model CityLast week I was hosted by Thomas Baldauf of the Austrian Environment Agency. I did not know Thomas but had got his name from a friend. After a short email he immediately agreed to host me without any questions which surprised me a lot. Unfortunately Thomas, the lead of the development team, did not have time to work with me in person but had prepared some developers from his team for my visit. I worked with Nexhat Gashi on a small feature of their newest web application which is based on JSF technology. I did not know JSF before I started my tour, but saw it all the time when pairing with people. Probably I will be fluent with JSF until end of November ;-)

I also worked with Martin Lackner whom I knew as long time attendee of our Eclipse DemoCamps in Vienna. Martin, an Eclipse platform veteran, worked on an MDA prototype using Xtext. I had worked with the older versions 0.7 and 1.0 before and he had prepared all the nitty-gritty details in the previous week. I reviewed his DSL and probably spoilt all his fun by proposing a different, shorter syntax. We moved forward very fast. In only one day we created a technical language to define entities and aggregates, together with full editor support, code completion, validation and proper formatting. Such is the power of Xtext - I love it. If you do not know Xtext, I really encourage you to check it out. The Eclipse Xtext project has excellent documentation and many examples which provide a starting point to get your DSL up and running in no time.

Free Lunch
My LunchThe only compensation I asked for pairing was food and beverages throughout the day. It worked out well - till now I have been provided with free lunch every day. All my hosts were very polite and offered me coffee or drinks and asked me for my preferences when choosing places to eat. I never asked for anything special but went for lunch where my partners went. I visited take-away noodle stores, staff canteens and fancy restaurants. Having lunch with many people, together with the various places in Vienna I have been to, was a culinary trip of its own.

The two weeks I spent away from home, I stayed in a hotel. The host company refunded me 600 Euro for my expenses per week. It was a nice hotel, expensive but comfortable. The money was sufficient because I saved on food, eating in the company canteen now and then. Staying in a hotel and working all day was acceptable for the two weeks, and I enjoyed the rich breakfast buffet including bacon and scrambled eggs. But I would not like to stay in a hotel for extended periods of time. I am not a travelling person and I never worked like that. I enjoy going home after work, where connectivity is good and wireless network is free ;-)

Can PL/SQL be Clean?
At the end of the week I spoke at the Austrian Oracle User Group. The organizer had planned an event focusing on clean development and three friends had recommended me to him independently. I agreed to give a presentation but was not sure about the topic I should talk about. For talking to an Oracle user group, the first thing that came to my mind was PL/SQL, Oracle's database language. I have seen horrible pieces of PL/SQL and the question was if it can be written in a clean way? According to Michael Feathers, the author of Working Effectively with Legacy Code, "clean code looks like it was written by someone who cares." I presented his quote as first rule of clean code. Continuing the discussion I listed several books about clean code, including Code Complete by Steve McConnell. Steve said to "write programs for people first, computers second", which I defined as second rule of clean code. Following both rules it was obvious that even PL/SQL can be written in a clean way. I got good feedback on my presentation, especially that it was very entertaining, so I encourage you to check out the slides on Slideshare.

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.