starting a program from scratch
Posted: 31 Aug 2005, 11:27
I failed to make a significant improvement in movei in the last months because the code is not well written.
I wonder what good advice do you have for starting a program again from scratch.
I think to keep my basic data structure but to avoid global variables that are not needed(I have too many global variables instead of struct) and I decided that I do not like trying to replace everything in my code.
I also want to use good ideas in fruit for better debugging so I plan to have function with similiar meaning as fruit in order to check if the board is ok and the same for other structures.
looking at fruit it seems to me that there are 2 files
posix and util that are independent on other files and have nothing to do about chess.
I wonder how do you start from scratch.
Do you start from files that have nothing to do about chess or maybe you start from files to make your move generator and files to check no mistake in the board and not care about things like time function first or maybe the order is not important?
Do you write first on paper all the functions that you plan to write and only later go to the coding process?
I am not sure if it is better if I start from a similiar structure to fruit(I do not plan to change my basic structure of the board so no copy and paste).
I am also not sure if it is better if I delay writing code and start writing code only after trying to figure out a full picture of what I plan to do inspite of the fact that I believe that I am already sure about some parts.
Note that evaluation will probably be the last thing that I plan to do in rewriting the code.
Uri
I wonder what good advice do you have for starting a program again from scratch.
I think to keep my basic data structure but to avoid global variables that are not needed(I have too many global variables instead of struct) and I decided that I do not like trying to replace everything in my code.
I also want to use good ideas in fruit for better debugging so I plan to have function with similiar meaning as fruit in order to check if the board is ok and the same for other structures.
looking at fruit it seems to me that there are 2 files
posix and util that are independent on other files and have nothing to do about chess.
I wonder how do you start from scratch.
Do you start from files that have nothing to do about chess or maybe you start from files to make your move generator and files to check no mistake in the board and not care about things like time function first or maybe the order is not important?
Do you write first on paper all the functions that you plan to write and only later go to the coding process?
I am not sure if it is better if I start from a similiar structure to fruit(I do not plan to change my basic structure of the board so no copy and paste).
I am also not sure if it is better if I delay writing code and start writing code only after trying to figure out a full picture of what I plan to do inspite of the fact that I believe that I am already sure about some parts.
Note that evaluation will probably be the last thing that I plan to do in rewriting the code.
Uri