difference in structure of chess engines
Posted: 25 Jun 2005, 13:53
When I look at the structure of fruit and glaurung I find one interesting difference.
Glaurung has only one .h file glaurung.h
Fruit has a lot of .h file and for every cpp file except main.cpp it has .h file
with the same name.
In Movei I have similiar structure to tscp and I have only
data.h defs.h and protos.h (and some tablebase code from nalimov that is also .h) when data.h is for global variables,defs.h for definitions of constants and structures and protos.h for functions.
I also have few classes because Dann Corbit adviced me to do it but I did not divide most of the variables to classes and I think that it was probably not a good idea to have classes because I find that fruit has no classes.
The fact that fruit has no classes suggest that using classes is not a good idea for chess programming because I guess that Fabien is the best programmer and he knows what he is doing.
I am considering to modify Movei and write it in the fruit way so every file knows only varaibles that are relevant to it by the right include.
First step in that case is to mark for every variable or definition or function in which files it is used.
Later I can decide to divide the definitions, variables and functions to different files
What is your opinion.
Is it a good idea?
Uri
Glaurung has only one .h file glaurung.h
Fruit has a lot of .h file and for every cpp file except main.cpp it has .h file
with the same name.
In Movei I have similiar structure to tscp and I have only
data.h defs.h and protos.h (and some tablebase code from nalimov that is also .h) when data.h is for global variables,defs.h for definitions of constants and structures and protos.h for functions.
I also have few classes because Dann Corbit adviced me to do it but I did not divide most of the variables to classes and I think that it was probably not a good idea to have classes because I find that fruit has no classes.
The fact that fruit has no classes suggest that using classes is not a good idea for chess programming because I guess that Fabien is the best programmer and he knows what he is doing.
I am considering to modify Movei and write it in the fruit way so every file knows only varaibles that are relevant to it by the right include.
First step in that case is to mark for every variable or definition or function in which files it is used.
Later I can decide to divide the definitions, variables and functions to different files
What is your opinion.
Is it a good idea?
Uri