Re: Circlemud design issues -0700"

From: James Turner (turnerjh@XTN.NET)
Date: 04/20/98

Doppleganger Software <doppsoft@TZC.COM> writes:

> I don't think that was the point that was being made.  The point was that
> with less header files, you have to compile more of the files more often.

Certainly, this point was made; I just didn't respond to it, being
caught in the other aspects of this issue and the others.  An
oversight on my part.  You are very correct that it can cause extra
recompilation.  However, in most cases, this isn't so big an issue, at
least for me; recompiling my code takes around a minute.  But rarely
is a change in a .h file going to occur only in one of the smaller
ones.  More commonly, changes will occur in one of the bigger files
(utils.h, structs.h), which will need a major recompile anyway.

It's pointless to have the same group of includes in a large number of
different files; if several headers are included in all the sources,
it generally makes sense to put them all into one.  Particularly if
those headers are simply prototypes (something I've done away with in
my code, at least manually; see the script posted elsewhere for
automatic prototype generation).

> source files, making db.scripts.c, db.object.c, etc.  Also, Chris' main
> point is valid, with bigger .h files, it means bigger memory requirements
> PER FILE.  Even if it's just a small file, like in my traps.c file, the
> compiling memory requirements would go way up, even if it is just
> defines, macros, and such.  I know it's a matter of personal opinion, but
> I'd rather have header files that are split so that the file only
> references them if it NEEDS to, not because it's got everything it
> absolutely need in it.

Compile-time memory requirements are not really an issue.  The compile
process is inherently file based, and broken into passes.  The extra
headers won't increase the compilation's memory requirements by
anything noticeable, particularly since: a) the compilation process
takes much more memory optimizing than in headers -- should we turn
optimization off? (IMO in general yes, but for different reasons).  b)
the memory it adds would be tiny compared to other processes -- even
tcsh requires over 600k of memory while running.

Memory is cheap.  Disk space is cheap.  Compile time is barely
affected.  Recompiling is an issue, but not a large one.


James Turner     

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST