[Dean's rant on the evils of global variables deleted]

> Given my extensive talks with Andy H on this subject both in the context
of
> the XML code and back at Taligent, I'm sure that I speak for him here as
> well.
>

I definitely concur with everything that Dean said.

The portability problems that crop up from the fact that the order of
construction of static objects varies with the tools, platform and build
commands are awful and never ending.  And different end-user applications
that themselves use statics with constructors  inadvertently introduce even
more dependencies on an ever-varying set of probably-not-initialized-yet
services.

The only clean solution is to just not use statics or globals with C++ style
constructors.  (Plain old C initialized-to-zero style global variables are
fine, as every system that I'm aware of gets all of these set before any
user code of any kind runs.)

If Xalan is depending on Xerces being alive and well at its (Xalan's) static
construction time, we should figure out how to get rid of that dependency.

  -- Andy




Reply via email to