Make Sure It’s The Master

I recently bought an external hard drive case so that I could back up all of my files. I’ve been running XP (yeah, yeah, I could be using Linux but the software for my Mini-Disc Player and Tablet Pen only works on windows), and thought it would be simple as plug-and-play. I had an old hard drive lying around, so I put it in the case and plugged it in. Sure enough, Windows was nice enough to alert me a “USB Mass Storage Device” was detected, but after hearing that nice little bell that indicates Windows found some new hardware, I was puzzled that no drive icon appeared in Explorer.

Initially thinking that it was my installation of Windows, I tried it on my laptop but to no avail. A quick google didn’t give me any better information, so I went back to basics and tried playing with the jumper settings. Sure enough, it appeared that cable-select mode was not enough and the pins had to be specifically set for Master mode. Now, to script the backup process…

Pair Pong (No, It’s Not About The Smell!)

Pair PongI’ve been a little bit quiet on the blogging front, both personal and work related (or at least it feels that way). The last few weeks have been busy, as I’ve been getting back into my normal routine (riding heaps!) coupled with the preparation of two major presentations. The first of these, intended for an audience internal to my company for this weekend, has had most of my attention for the better part of last month. The second, which had been the focus of this month, was for the Agile India conference that I had been accepted into. This presentation (more like a workshop), titled, “Priming the Pair Programming Practice For Production” (I couldn’t resist the alliteration), was aimed at providing an environment for people to experience pair programming first hand, with the benefits of coaching that would usually be lacking in the workplace.

I had been designing the session to expose people to both the benefits and challenges associated with this practice that is best learned with hands-on experience. Unfortunately for me, due to a whole series of recent events and bad timing, I have had to withdraw from the conference.

Now that I will not have the chance to actually run my workshop, I may as well describe what had been planned. In addition to going over the thinking behind pair programming, all of my exercises had been designed to give as much practice as possible, coupled with constant feedback, to pair programming and other agile practices. The first two exercises were intended to be fairly trivial, a programming problem to be tackled in pairs, the second, a pair programming refactoring session. I was probably most looking forward to the third exercise (especially from the participant’s reactions) which I had named “Pair Pong”, after the game “Ping Pong”, combining pair programming with the agile practice of Test Driven Development (TDD). Much like the real game, a token (in this case, a keyboard) would be constantly passed around between the pairs. One partner would write a test case to represent a requirement out of a given list, while the other would write enough code to get it working. The roles would swap and the game would continue until all the requirements were complete, with the aim of the pairs to only ultimately communicate via the code they passed between each other.

Although the “Pair Pong” concept is not new, I think associating it with something that everyone can relate to can make it easier to actually implement. I’m sure I’ll have an opportunity to run with this workshop one day; I just know it won’t be next week.

A Comment Saved Me Today

I like to think I have a very strong trust in all the members of the team I work with to tell me things I need to know to get my job done. My team members may not always be there right next to me, feeding me tidbits of information, so I trust them to leave what they were thinking in the code they leave behind. Sometimes it is harder to read some people’s thoughts, but most of the time, I get what they are saying. It’s always a great day when someone has the courage to put that comment down that saves you hours of trying to work out why something works the way it does without delving into its great recesses. Thanks for the comment and the hours you saved me today in my bug fix.

Simplicity Lost in 3D

I don’t know about you, but if I see a three-dimensional array being returned by a method in Java, alarm bells start going off (without, of course, suitable (and it better be mighty) justification). I have no idea how this method was added to the code base without review by another developer (my guess is that it wasn’t), but proper developer hygiene and good conscience (who would want to inflict it upon anyone else?) won’t let me leave it there. After studying the single method for over half-an-hour and dragging over the original author, I finally realised what it’s purpose in life was.

There are already far too many articles about what simplicity is (try this link), but my favourite rule of thumb is, if you have to stop and think about what code is doing while you’re reading it, it may be excessively complex. I avoid writing complex code, not because I am lazy or stupid, but because it is a waste of time that prevents me from writing other code that adds greater business value.

On Pair Programming

The other day, I commented on how I had participated in my first proper pair programming session. Compared to the “pairing” session I had back in November, (where I was, more often than not, the back seat passenger instead of Navigator) this experience beat it hands down. As keen as I have been in the past to attempt pair programming, project constraints have never really been conducive to real pair programming. Luckily I had been preparing for this opportunity unwittingly by reading “Pair Programming Illuminated“. The book that Brett had kindly loaned me was an excellent resource for describing constraints that hinder and identifying techniques to improve pair programming practices. Read more “On Pair Programming”

A Perfect Pair Programming Experience

I’ve been working on a story card that is part of the “critical path” by enhancing a framework not really designed for what we need it to do (not that they ever are). I have almost no test coverage, very little documentation and a completely different architecture and context to work in. I think that after today, I can honestly testify to my first proper pair programming experience. I intend to write more once I identify what made it all flow, but let’s just say I’m hungry for more. Stay tuned.

You know it’s not a good sign when…

A RAM test doesn’t stop reporting numbers like this. The computer I develop on at work started freezing after numerous JVM shared object crashes. Testing the RAM in another machine and other RAM in my machine seemed to indicate that a) the RAM had not been properly installed in the first place, b) had magically come loose over the weekend, or c) is dodgy RAM (I’m voting for the latter). This is the first day that I have been unable to develop any code, it made for a very good opportunity to do other things.

All About Ant

I’ve always been frusted by the (lack of) information contained in Ant’s so called ‘Manual‘. Considering it has been around for so long, I have found it lacks the wisdom of best practices or tips for writing more maintainable scripts. I probably should have bought copies of Ant: The Definitive Guide and Java Development With Ant but I have never really needed it (and I was sure its contents must already exist on the web). Little did I realise that this page existed with more than enough of the sorts of information I wanted. Oh, and their wiki is well maintained too.