Re: [Fresco-devel] Suggested addition to Coding Style-guide
Neil Pilgrim <[email protected]> Sun, 13 Apr 2003 00:45:35 +0100
| Newsgroups | gmane.comp.video.fresco.devel |
|---|---|
| Message-ID | <[email protected]> |
I didn't think this was going to be so controversial! Stefanus Du Toit wrote: > On Sun, Apr 13, 2003 at 01:14:53AM +0200, Gabriel Dos Reis wrote: > > When build times is really an issue, I believe using that using > > things like precompiled headers helps much more than declaring by > > hand which entity one uses. At least, that is my exprience with > > large projects. > > Using a compiler cache should also all but completely eliminate this > particular issue. Surely that depends on what parameters it indexes upon? That's not to say it wouldn't help :) > I didn't realise that "regular" gcc supports precompiled headers these > days. Since when is that the case? AFAIKnew this was just a branch somewhere, not mainstream...I'd be interested if its not :) > > A frightening downside of forward declaring "by hand" is the same as > > why you don't want code-duplication: Every minor change needs to be > > done at zillions of places, whereas including a forward declaration > > header keeps the changes in one place. > > I think this is a reasonable point. A decent place to draw the line > for Fresco may be one file per directory, since for the most part > things are fairly well compartmentalized. Of course this is parallel to iosfwd, which I thought the main reason for using was since there was the issue with templates and typedef's, not for the code-duplication reason above. I didn't consider 'class foo' to be much duplication. That would work quite well; perhaps having a fwd_decl.hh file in each dir? OTOH if you change that file, you end up recompiling everything that includes it, for whatever feature it includes it for. But perhaps a compiler cache solves this. I'm not so bothered what we do, as long as we have a policy/standing on it, so I know what to do. Thanks for the input, -- Neil