Re: A roguelike programming contest



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

.



Relevant Pages

  • Re: New Attack / New Vulnerability?
    ... "This appears to be an IE 6 client on XP with Office XP installed. ... configuration enables the discussion bar in IE. ... When the discussion bar is enabled and configured, ... > This list is provided by the SecurityFocus ARIS analyzer service. ...
    (Incidents)
  • Re: Composite index and data distribution
    ... SQL> create table foobar(foo number not null, ... COMPOSITE INDEX (BEST I CAN THINK OF FOR THE QUERY TO BE EXECUTED): ... SQL> select foo, countfrom foobar group by foo; ... 395 bytes received via SQL*Net from client ...
    (comp.databases.oracle.server)
  • weird behavior ( browser or C# )
    ... I have a problem with a new C# DHTML chat server I am making. ... When I open 3 new instances of IE and connect the first client to ... bar the first client displays "3" in the status bar and the 3rd client ... lNetworkStream); ...
    (microsoft.public.dotnet.framework)
  • Cannot establish certificate chain for client authentication
    ... IntermediateCA cert: bar (foo signs bar) ... Both servers have ssl client ...
    (microsoft.public.inetserver.iis)
  • Cannot establish certificate chain for client authentication
    ... IntermediateCA cert: bar (foo signs bar) ... Both servers have ssl client ...
    (microsoft.public.inetserver.iis.security)