Upgrading the hard way…

Yesterday I decided to upgrade WordPress on this site. As usual I ignored the tip about backing up first and just pressed the Upgrade Now button. As you can imagine, it failed big time so my only option was to reinstall. Luckily, I was able to export my posts using phpMyAdmin, but when I was trying to import them again after the WordPress installation, the fun began… The column count did not match, so I had to update all posts manually before importing.

I think I have got it all up as it was now, with a few new features such as link to my google+ profile and the nice little +1 button below the posts. Next time I am definitely going to follow the recommendations of backing up the data…I think

Architect’s Role Revisited

I have touched this topic in at least two previous blog posts (Agile Architect and Agilists and Architects), but I seem to be getting into these kind of discussions on a pretty regular basis.

The main area of conflict or misunderstanding is usually around how to create a common architecture or framework (…ouch…) for the entire organization. Most managers and old school dinosaur architects seem to believe that this is best done in long meetings and by producing endless powerpoint presentations and documents containing every buzz word in the world.

I can not stress enough the importance of building an architecture from something that already has been proven to work. And to be able to do that, you as an architect have to get your hands dirty doing some actual coding. An architecture should always be communicated through code, not by slideware!

Øredev 2010 – final thoughts

Having attended all previous Øredev conferences I think I am pretty qualified when I say that this year’s conference was by far the best. Great topics, excellent speakers and flawless organization. Even the closing panel debate, which usually is just something you have to suffer through to be able to win prices in the raffle at the end, was interesting this year.

Since it is such a diverse conference, it is difficult to point out a single item that was the main trend at the conference. But if I should pick one thing, I guess it would be that most of the talks I attended more or less circled around the Get Real! theme of the conference. Hopefully this means that the industry is getting more mature. Don’t want to be a self-fulfilling pessimist, so it is just to be optimistic 🙂

See you there next year!

Architect’s Java DAO Generator

Usually, when I come home from work, I am pretty tired of programming and rarely ever do any programmin during weekends. But this weekend was different. I have been coding pretty much at work lately, so it should not be because of abstinence from coding. Anyhow, I set down and contributed to a small open source project started by a former colleague of mine. It is called Architect’s Java DAO Generator, and you can find it on Sourceforge. In short it is a maven plugin that generates most of the boilerplate code you usually have to code by hand. It also abstracts the data access layer from your domain logic in a nice way. Version 1.5 is soon going to be available and is absolutely worth a look.

Candidate for Daily WTF

To cry…or laugh…that’s the question…

@Test
public void spaceFiller() {
   int l = 5;
   String result = MessageUtil.spaceFiller(5);
   if (result.length() == l) {
   } else {
      fail();
   }
}

When I came across the test code above I wondered who on Earth would write such a thing. The answer came shortly after when I had a look at the method it is testing…

/**
 * Space filler.
 * Creates a string filled with spaces of the wanted length
 *
 * @param length the length of the wanted string
 * @return the string
 */
public static String spaceFiller(int length){
   String s = "";
   for(int i=0; i < length; i++)
      s = s.concat(" ");
   return s;
}

The good thing is that they actually wrote a nice and clear JavaDoc explaining their own stupidity…

Are Unit Tests Necessary?

At work today I came across a project that had not written a single unit test for their new code and wondered what the hell they were doing. Nothing unusual except that apart from the usual excuses about time constraint etc., they had the guts to challenge the value of unit tests. I did not believe what I heard and for a moment wondered if I had gone through some kind of time capsule when I was visiting the pyramids in Cairo last week and come back in a time before unit testing was invented. But a quick glance at the date on my watch ensured me that it was still 2010.

The only comforting thing about this is that as long as there are projects like this, there will be plenty of work for software consultants to clean up the mess. Just a pity that the first couple of weeks will be spent writing unit tests to be able to start refactoring the code. Good thing that writing unit tests are pretty fun and addicting, or to quote one of Kent Beck’s tweet earlier today “… tests are like potato chips”.

Corporate Blogging – a fresh (re)start

I have agreed to contribute with a post once in a while on the corporate blog, or newsroom as they call it. I know I have not been very active on this blog lately, but hopefully this will inspire me to be more active here as well. Having just come back from a couple of weeks of total relaxation and diving in Dahab, Egypt, I should be full of energy and an urge to get started writing.

But first I want it to be absolute crystal clear that the stuff I write her on AgileJava is my view, and my view only. It is by no means affiliated with the company blog or anything thereunder. The posts on the newsroom will be reviewed by company representatives before published whereas AgileJava is only reviewed by myself.

Dilbert on Corporate Social Media

A Special Year

The first time I attended JavaOne was 1999 and I have only missed it once since then. Sadly, this year will be the second time I am not present there. I have become kind of used to the week in San Francisco every year. It is the perfect way to start the summer with a visit to that beautiful city. Since it is in September this year, it would probably been the perfect way to end the summer (…we have short summers here in Scandinavia…).

I will for sure miss the massive input and inspiration this conference gives me and enables me to keep up-to-date on everything that is happening in the Java Community. This year’s conference is also special since it is the first time Oracle is hosting the show. It feels like a good idea to co-host it with Oracle Develop and I hope it will be a success to be continued. Next year, I will definitely be attending, one way or the other…!

Daily Scrum for Distributed Teams

Even if you are using Scrum or any other development model, agile or not, it is always good practice to have a short status meeting with your team every day. Usually the best time for such a meeting is in the beginning of the day as it gives the team the chance to resolve any issues the same day. Having the meeting in the afternoon implies that any issues probably have to wait until next morning, which is usually not a good thing.

So far, nothing new. The practice of a short stand-up synchronization meeting is pretty well established and non-disputed.

What if you have a team that is distributed not only in distance, but also over different time zones?

Which time zone should be used as basis for determining when to have the meeting? Usually the project it ends up being run by the project manager’s (*) watch. That means that the team in the other end probably will have the meeting in the afternoon. A pretty usual distributed team setup in Europe nowadays are something like this:

Europe: Project manager, architect, test manager
Offshore (China or India): Lead developer, developers, testers

That means that the largest part of the team, the team that actually are doing most of the work are having the daily scrum at a less optimal time of the day than the project management. I think that to really succeed with distributed agile development, you have to let the team decide how to work even if this implies awkwardly timed daily scrums for the project management. Of course, this applies to other aspects of the development process as well.

(*) …or Scrum Master if you prefer…