Mosquito Coils and Software Design 2008-10-10 Kevin Walker software design (0) For those of you that live in the Southern Ontario region you know that the summer of 2008 will go down in the records books as the rainiest summers on record. The weather was often sunny and warm, but when it rained it really came down hard. Unfortunately there is a little pest known to us all that could not be happier that we had a long, warm, and wet summer – the mosquito. My last trip up to Muskoka area was in late September and there were still a few mosquitoes around. Every year in August my family rents a cottage in Muskoka from and old colleague. The cottage is great; very rustic and private. It is deep in the woods so the flying pests can be very thick especially at the end of the day. We never wanted to miss out on a chance to eat dinner outside in the beautiful evening weather, but the mosquitoes could make it uncomfortable. Usually I would crack out two of the DEET laden mosquito coils and spark them up just before dinner and let them burn away throughout the evening. One evening I was looking at the coil stand and it struck me what a brilliant design it is. For those that have never experienced the joy of using these coils I will explain the workings. The stand comes in the box completely flat and folds out 90 degrees to reveal a rounded point at the top. In a perfect world the entire coil sits atop of the stand and burns for a few hours until nothing is left but ash. In the real world most of us throw the remaining coils into a box with other assorted camping implements only to find the coils cracked into many pieces the next time we use them. This is where the brilliant design part comes in. The centre of the mosquito coil stand has a funnel shaped “gap” that allows you to wedge a broken coil piece in and still burn it. I was not around when the first version of the mosquito coil stand was created so I don’t know how it came to be the way it is. I have to assume that consumers would complain that their coils where always breaking and would no longer sit on the stand. The manufacturers were faced with the dilemma of how to make a stronger coil. Then someone had a great idea – let’s accept that the coil is going to break and design a stand that will still allow the consumer to use the broken pieces. Everyone is happy. What does the mosquito coil have to do with software development? Far too often I hear the business users talk about only accepting an application when it is “bug-free”. Developers perpetuate this myth by talking about “zero defects” in their solutions. In twenty years of working in the software industry I have yet to see a piece of software that does not have defects in it. What we need to do as software architects and developers is to adopt the mindset of the coil stand designer. Our products are going to have defects – they will crack into pieces occasionally. But a well designed product can anticipate this and allow the user to continue to use the product will little inconvenience. In essence we need to design our software to have both the round tip on the top for normal use and the funnel shaped gap in the middle to accommodate the broken pieces. How do we do this? There are many techniques that can ensure that your software products can withstand the test of time. Defensive programming, object oriented design, and services oriented architectures are just a few examples. In my next article I will discuss how some of these techniques can be used to ensure that you design the mosquito coil stand of the software industry.