Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: No Bitboard Discussion here

Author: Tord Romstad

Date: 03:18:47 08/31/03

Go up one level in this thread


On August 31, 2003 at 00:39:50, Peter McKenzie wrote:

>On August 30, 2003 at 14:37:44, Tord Romstad wrote:
>
>>My program has reached the stage where it is so complicated and ugly that I
>>no longer understand clearly how it works (it's rather miraculous that it
>>works at all), and there are many parts of the code which I am afraid of
>>touching because I am sure I will break something.  Besides, the program
>>is horribly slow, searching only about 120 kN/s on a PIV 2.4 GHz.
>>
>>Because of this, I think it is time to throw away all the old code and
>>start from scratch.  Before I do this, I will consider replacing my
>>data structures with something more efficient.
>
>Hello Tord.  Sounds to me like you have a basic software engineering problem
>that you are hoping will be magically solved by a rewrite.  What is to guarantee
>that if you do a rewrite, you won't find yourself in a similar position in 6
>months time?  Sure you might have bitboards, but if you don't understand how
>your current program works then why should you understand how a new program
>works?

Because most of my current code was written several years ago, when I
was an even more incompetent programmer than today.  Most of this old
code is simply completely rotten, and I would have written it very
differently today.  It is neither efficient, readable nor easy to
change.

>In general, my belief is that a rewrite should be a last resort to solve such
>problems.  I think you'll gain more by writing unit tests for your existing
>codebase, then take a refactoring approach.  The unit tests will allow you to
>safely refactor your existing code, because they will pick up anything you
>break.
>
>The main benefits of this approach are:
>- you keep a working program throughout the process
>- you can keep the good parts of the existing program, and fix the bad parts
>- you learn more about the mistakes you have made

Thanks for the advice.  Perhaps it is worth a try, but I'm afraid it will
be even more time-consuming than writing a new program.  And I am not
sure there are any "good parts of the existing program" to keep.  It
all looks disgustingly awful to me.

Another reason to do a rewrite is that I want my program to run fast on
the PowerPC G5 processor, which seems to be rather unimpressive apart from
the fact that it is 64-bit.

Tord




This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.