Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: question about errors when I change my C code to C++

Author: David Rasmussen

Date: 10:51:39 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:
>
>>
>>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
>

With include guards and consistent use of prototypes, in general using the
modularization facilities of C++, there will be no problem.

>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.
>

There are many advantages. The most important ones are
1) Encourages good design traits by minimizing dependencies
2) Compile times are lower in general, because only the (small) file changed
will have to be recompiled.

/David



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.