Re: A roguelike programming contest
- From: Keith H Duggar <duggar@xxxxxxxxxxxx>
- Date: Wed, 08 Aug 2007 18:38:45 -0700
On Aug 7, 2:42?| am, Krice <pau...@xxxxxxxx> wrote:
On 7 elo, 05:15, Keith H Duggar <dug...@xxxxxxxxxxxx> wrote:
Is this a sign that the g++ library is poorly designed?
No.
Ok, then your earlier proclamation:
In some cases including another header inside header is ok,
but it's a sign that the design is poor.
was empty rhetoric safely ignored.
Seems like a giant headache for effectively no gain and it creates
a maintenance and portability nightmare.
Not true. The idea is that a module includes only the headers
it's really using.
Unfortunately a module must directly or indirectly include
declarations and sometimes definitions for all names whether
or not that module uses them directly or indirectly. Forcing
a client to directly include headers needed only indirectly
degrades rather than improves of modularity.
When you include everything inside the
cpp module you can see how the dependencies work.
Why should a client care and more importantly why should a
client be /forced to manage/ the implementation dependencies
of a module it's using? For example:
class Foo {
Bar _bar ;
public :
void doSomething ( ) ;
} ;
Your proscription would force a module using Foo to write:
#include "bar.h"
#include "foo.h"
even if that module does not directly use Bar itself. Why
should the module need to care that Foo's implemenation is
using Bar? Why should the client be forced to manage this?
When the implementor of Foo changes Bar to Baz then what?
Hint, the client must be /rewritten/ (not just recompiled)
which is a degredation of modularity not an improvement.
How do you think this improves modularity?
Also in large projects it's making compile times faster
if there are less dependencies and only files that are
associated to the module are compiled when something is
changed.
Forward declarations /where possible/ help reduce compile
times. Your method offers no such improvement since every
translation unit will still include the necessary headers
or it simply will not compile. You have merely moved the
responsibilty to client module where it does not belong.
It's a kind of mechanism that makes you think about the
structure of the source code and avoid bad decisions that
lead to messy and poorly structured source code.
No. It's a mechanism that struggles against the current
structure of C++ and merely adds work and hassle for no
gain. The language supports a method entirely different
from what you decribe that achieves, when possible, the
effects you seek: forward declarations.
KHD
.
- Follow-Ups:
- Re: A roguelike programming contest
- From: Krice
- Re: A roguelike programming contest
- References:
- Re: A roguelike programming contest
- From: gerryq
- Re: A roguelike programming contest
- From: Gerry Quinn
- Re: A roguelike programming contest
- From: Gerry Quinn
- Re: A roguelike programming contest
- From: Krice
- Re: A roguelike programming contest
- From: Keith H Duggar
- Re: A roguelike programming contest
- From: Krice
- Re: A roguelike programming contest
- From: Keith H Duggar
- Re: A roguelike programming contest
- From: Krice
- Re: A roguelike programming contest
- Prev by Date: Re: Test Adventure
- Next by Date: rec.games.roguelike.development scheduled for sporge flood
- Previous by thread: Re: A roguelike programming contest
- Next by thread: Re: A roguelike programming contest
- Index(es):
Relevant Pages
|