Monday, March 12, 2007

Is It Good Enough?

This week the first round of the Marathon Match for the TCO '07 started. In a "marathon match" they give you a problem and you have a week to come up with the best solution you can. It's usually fairly easy to come up with a working solution, the trick is to come up with a good one. Unlike the TopCoder algorithm matches, there isn't a right answer, rather your program is judged based on the quality of answer it provides. For example, if you were trying to solve the travelling salesman problem, you might be judged based on the total distance your route takes.

I don't need the best programMy dilemma is how much time to spend on this problem. I love these sorts of contests but this week - Wednesday through Wednesday in this case - is fairly busy for me and I don't have a lot of spare time. In this first round 500 people advance to the next round. So I don't need the best program, I just have to be good enough. I've spent a couple hours coming up with and coding a solution and as of the time of this writing, I am in 132nd place. Is this good enough? Will 369 people come up with better solutions than mine in the next 2.5 days? I don't know.

There is something satisfying about the TopCoder algorithm matches where you program has to pass every single input exactly or else you get no credit. It is similar to many school homework assignments where you have well defined requirements to solve. In these cases it is much easier to know when you are done. If it satisfies the requirements, it is done. Unfortunately, in the real world, problems are more like the marathon match problems. Programs aren't right or wrong, rather they are better or worse. You can always improve things if you spend more time.

So how do you know when to release your code? Does your software escape leaving a bloody trail of designers and quality assurance people in its wake? Perhaps it is never finished - it simply stops in interesting places.

Given that there are always other projects to work on, I think this is a very important question to answer, whether at the class level, the component level, or the entire project level. The ability to know what is good enough is one of the differences between companies, teams, and individuals that succeed and those that don't.

No comments: