A Pragmatic Approach to Continuous Delivery

Summer time means less people at work and more time to think ahead what to do the remaining part of the year. In my case it means that I have signed up for a talk called A Pragmatic Approach to Continuous Delivery at jDays, a Swedish Java Developer Conference located in Gothenburg. Read the abstract here, and vote for it here if you think it sounds interesting.

While I was at it, I also proposed a lightening talk on the same subject to Smidig 2012, a Norwegian Agile Developer Conference in Oslo.

Responsive Web Design Demystified

This post is not about generating traffic. Nevertheless it probably will since the concept of Responsive Web Design is pretty hyped these days. Everybody seems to be talking about it an I am a bit concerned that the wrong people will start thinking it is the solution to everything without understanding what it is.

First of all, it is not about technology. The technologies and techniques involved have been around for a while, even though they are constantly improving hand in hand with the browser support for CSS3 and HTML5.

Responsive Web Design is all about mindset. It is about getting away from the print-on-paper-influenced-960px-wide-look-the-same-in-every-browser way of thinking. It is about convincing the customers that it is not only okay, but actually required, that your site looks different in different browsers. It is about creating the best possible user experience regardless of what browser or device you are using.

Just remember that there are still lots of situations where the responsive approach is not the way to go and a “mobile” or “tablet” version of your site is the preferred solution.

7 reasons to upgrade to Java 7

Java 7 is finally here! Or to be absolutely correct, will be released July 28. In this post, I will point out 7 (wonder where I got that number from…) reasons to upgrade.

  1. Coins are also money
    Project Coin contains a couple of nice language changes that will make life as a programmer much easier. See the project page for details.
  2. Dynamic languages
    invokedynamic adds support for dynamically typed languages on the Java platform.
  3. New File System API
    File operations have always been pain in Java, but with this new API most of the issues are solved. Manipulating symbolic links for example.
  4. Concurrency
    The Fork/Join Framework provides a set of utilities you would benefit from when writing concurrent programs, giving the possibility for true parallelism on the Java platform.
  5. Modularization
    A refactoring enabling the Java SE platform to be downloaded as required by the VM as needed. 
  6. Enhancements
    A lot of enhancements regarding classloading, unicode, locale etc.
  7. It’s new
    And new things are always more motivating to work with than old, at least in the context of programming languages.

To be honest this is not very much for a major version of a programming language, especially since it has gone nearly five years since the previous version. But it shows that Java is still alive after the whole Oracle story.

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 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”.

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…!