Computer Chess Club Archives


Search

Terms

Messages

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

Author: Matt Taylor

Date: 18:50:25 02/25/03

Go up one level in this thread


On February 25, 2003 at 12:40:18, Uri Blass wrote:

>On February 25, 2003 at 12:31:14, Pat King wrote:
>
>>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
>>
>>I would submit that this is a bad feature of tscp.
>
>so what do you think?
>
>Do you suggest to include all the definitions and the external varaibles in the
>same file?
>
>I do not see why it is a problem except the error that I reported and finding
>and fixing the error took me only few minutes.

Yes, but it is easier in the long run to not have to worry about that error, and
the fix is equally trivial -- just include one file from the other as you
suggest.

>>>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
>>
>>A lot of files, if organized correctly, can mean quick compiles after small
>>changes. If a small change produces a big recompile, then it's a sign that your
>>program's structure might need rethinking.
>>
>>Pat
>
>compiling the program takes a short time and it is no problem even to compile a
>file with more than 5000 lines.
>
>Uri

Assuming it stays around that level. However, with 5K LOC, my projects usually
take more than a short time to compile. On my 1.4 GHz AthlonMP 1600 (note that I
can only use 1 CPU in VC), it takes probably 10 seconds to completely rebuild
projects around that size. Part of this is due to the fact that the compiler has
to be spawned multiple times against multiple files. If I simply build changes,
the entire process can take less than 3 seconds.

5K LOC is a small project. As movei grows, it will get bigger and bigger. Using
modules will save you compile time -- perhaps not now, but in the future.

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