Author: Daniel Clausen
Date: 05:45:51 06/30/02
Go up one level in this thread
On June 29, 2002 at 09:26:08, Russell Reagan wrote: >On June 29, 2002 at 05:32:08, Daniel Clausen wrote: > >>Bad dependencies will hurt, sooner or later. > >So if I use the move->toString(ALGEBRAIC, &position); approach, is that being >dependant? Also, what do you mean that it will hurt sooner or later? How will >it cause problems? If I later decide to change how move or position is >implemented, then I will have to change the other accordingly. >Is that what you mean? > I assume that you have a header-file Move.h which contains a prototype/declaration for the method toString. Therefore this header file has to include Position.h (assuming this thing is in its appropriate header file - many people prefer to have a Types.h or Common.h for often-used data-structures) Now at every place where you include 'Move.h', you indirectly also include 'Position.h', which can cause circular includes later. Sometimes this is not a problem (although it's not really good from a design POV), and sometimes it causes problems and you have to resolve these with forward declaration. Sargon
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.