Bugs Bugs Bugs!
The chess engine Fruit has many strengths; one of the main ones I believe is simply the lack of bugs. Fruit’s author Fabian Letouzey has a defensive coding style. He litters his code with “assert” statements. When he was actively developing Fruit he set out a challenge – he said if you find a bug in Fruit he’ll fix a bug in your code (can’t find link). I think this highlights his emphasis on finding and fixing bugs. This philosophy has certainly influenced my coding style.
So now Maverick 0.2 is out I’ve spent most of my chess development time finding and fixing bugs. There is a great temptation to add knowledge, feature and improve the search. But a couple of times I’ve sat down and just focused on finding bugs. On some occasions I have a specific bug or odd behavior I have identified and which I’d like to fix. But often I’m just hunting for bugs. I might set myself the goal of finding ten (small) bugs in two hours. I then go through Maverick’s code with a fine toothpick, forcing myself to challenge the logic of every line and asking myself what I’m assuming at each stage. It’s amazing what you discover. If you have a chess engine give it a try. Set aside some time to focus on simply finding bugs.
Let me know how you get on!