Author: Matt Taylor
Date: 18:42:34 02/25/03
Go up one level in this thread
On February 25, 2003 at 11:51:15, Uri Blass wrote: >On February 25, 2003 at 11:42:24, Pat King wrote: > >>On February 24, 2003 at 18:00:25, Uri Blass wrote: >> >>> (long story with easy ending) >>> >>>I see that I did not include it in the right order and now I have no problem. >>> >>>Uri >> >>I would submit that being dependent on include order, though perhaps not a bug, >>is bad practice. All my includes are in alphabetical order. While this doesn't >>preclude such dependencies, enforcing an arbitrary order at least ensures they >>are repeatable :) >> >>Pat > >data.h is varaibles when defs.h is definition. >I learned it from tscp. > >some varaibles are dependent on definition so I need to include defs.h first > >Maybe it is better to have only one file for them but when I look in source code >of Crafty I see that it has a lot of files in the project. > >I do not understand what is the advantage of having a lot of files on the >project. > >Uri Many files enables you to recompile only the changes you make. It isn't a big deal with smaller programs, but when you have many thousands (or millions) of lines of code, it is very valuable to save yourself compilation time by only recompiling what is necessary. That is best done by using multiple files. Also, using multiple files promotes code coupling -- like code gets grouped into a module, and this promotes good design through data hiding. If data.h is dependent on defs.h, you should probably include data.h from defs.h. This way you won't need a specific include order. -Matt
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.