Hi Alain,
Alain Baeckeroot wrote: > Hello again > > This is just an argument for keeping the code as simple as possible, and not > introduce exceptions when we can avoid them. > > Here is one good example of what i call "newbie-confusing complexity" :-) > > examine_position is 100 lines function (in engine/genmove.c) > > * The parameter how_much tells us how much of the work we have to do. > * For move generation we have to do it all. For debugging we can > * sometimes stop a little earlier. > > As far as i understand, the normal flow of operation fits in 10 lines, the 90 > other lines are here for debugging purpose. > But thats 900% overload for my brain ;-) . Instead of reading it in 30 > seconds, i spent a lot of time (maybe one hour) to be sure i do not miss > something within all the tests. First of all the code flow there could certainly be simplified, without losing any functionality. Maybe I can get around to do this at some time. Generally, I fully agree that this kind of special-casing thing has serious costs. I am always in favour of throwing out special case code that is only needed in rare cases and makes the case less readable. Patches simplifying some piece of code are always welcome. However, in this case, the comment above is a little misleading. This "stopping earlier" happens in every reading/connection/life-and-death regression test, and it would make the runs of owl.tst a lot slower if we removed the "how_much" parameter. Arend > Maybe the debugging code could be #ifdef DEBUG , but thats a big job and > another problem... for gnugo 3.10 or 4. ? > > regards > Alain > > > _______________________________________________ > gnugo-devel mailing list > gnugo-devel@gnu.org > http://lists.gnu.org/mailman/listinfo/gnugo-devel > _______________________________________________ gnugo-devel mailing list gnugo-devel@gnu.org http://lists.gnu.org/mailman/listinfo/gnugo-devel