The Crazy World (tm) of Rob Miles

Wednesday, August 20, 2003

Pay for Your Mistakes

It pays to improve your word power dept: Moribond - noun: secret agent who hasn't been out much lately.

Spent all day paying for a silly mistake what I made. I've produced this rather nifty layout manager for .NET. It is designed to take the place of the lovely GridBagLayout which is provided by Java. We are using it in "the product which cannot be named" so that we don't have to place things like text, edit boxes, displays etc, on the windows by hand - and the windows can scale and resize themselves properly.

However, when I created it I made a bad design decision. Bad decisions have a way of coming back to haunt you - especially when they are in the underlying design of your system. I was getting to the point where I was spending more time thinking of ways to get round the problem (i.e. add more and more kludges) than it would take to fix it. So I fixed it. Made a simple change to the design and got around 900 compilation errors for my trouble, which I then had to work through and fix.

By the end of today I am down to 300 errors.

As for the fault, comparatively trivial, but very annoying. I made the layout information a property of the window component, not the other way round. This seemed OK when I wrote the first version, but when you want to start making components and deciding where to put them afterwards (which is what you end up doing) you are in a big mess. You have to invent "dummy" layout items just to keep the system happy (which is a kludge). The design now works the other way round. Layout items are assigned components to manage. We can easily change what appears on the screen and everyone is happy. And I've got backache...

0 Comments:

Post a Comment

<< Home