Friday, February 20, 2009

Unfun things

Programmers tend to loathe writing documentation. I always have great documentation in mind while I am developing a nice solution to a problem, but it rarely gets realised. Usually the bare minimum gets done – sometimes less than that.

Another thing that is probably number two on the list of most not fun to do is error handling and logging.

I have just spent a little time cleaning up the error handling in the couple of applications that I am writing right now.

There are various components, running across various platforms – Windows and Web clients, .NET Remoting servers, Windows services, Web services, ASP.NET web sites (that are actually generated from specifications in xml files that are in turn created by a tool – one of the windows client applications). Anyway, the whole thing is getting a little too complex to hold in your head at once, and before it gets too complicated I wanted to put in a common logging component. I have wanted to do it for a while – get away from each component knowing how to ends an email or write the windows log. Now it is mostly done.

I guess the whole point of this ramble was just to say that I got myself to do something pretty unpleasant – fix up exception handling chains, move chunks of code around while deciding which of 3 similar implementations are correct, fix up dll referencing issues, test error conditions – by giving myself something a little but fun to do – write a nice class using generics to build and hold an error message (so a message can be build up as different components have more or less important problems), grow the re-usable library that I have and actually re-use it.

No comments:

Post a Comment