Tuesday, May 02, 2006

Why Fine-Tuning Software Can Be So Time Consuming

Most people who have never been directly involved in the creation of software have no appreciation for or idea why it [often] takes so long to build. An example just came up that I thought I'd share. Pictured on the left is the Question panel in the Desktop component of my forthcoming software, Pocket Pollster.

Each button represents a question. If you wish to examine Question #2 then just click on the "2" button. Originally the panel underneath these buttons was a consistent light blue. But I found an easy way to replace every such panel with a gradient panel instead. With these panels, the colour at the top is different from the colour at the bottom, much like the sky during a sunset.

The order of buttons can be changed by the user by simply dragging & dropping. This is common practice in most newer Windows software. To give the user a visual clue about where the new position of the question will be, I had the software draw a small black line between buttons. When the user moved away from that position (though still in dragging mode) the line would be erased by simply drawing another line over top of it. This new line would have the same colour as the panel, thus giving the illusion that the black line was being erased.

This graphical effect worked great! But then when I switched over to a gradient panel I discovered that the black line was not disappearing. The reason was that the colour of the panel was not consistent and thus the little trick I had employed no longer worked.

After some research and some help from a kind fellow on one of the MSDN forums, I finally discovered how to produce the effect again. Rather than drawing another line on top of the black line, I instead got the software to refresh (redraw) the section of the panel where the previous black line was drawn. This effectively erased it, and the desired effect was restored once again!

But I had no idea how to do this and so it took several hours of research and a little trial and error to get it to work. Multiply this by 100 or 1,000 and you begin to understand why software takes a long time to get perfect.

No comments: