"Peter van Merkerk" <> wrote in
news:bfkbpi$fj9r0$:
>>
>> Microsoft thinks defined like "BOOL" and "WORD" make sense, so I'm
>> not quite sure invoking problems with their source code is credible.
>
> The Microsoft Windows API is written for C compilers somewhere in the
> eighties, they could not use C++ features. The choices they made do
Yes I remember, they were wrong then and are wrong now, but chose not to
bite the bullet and re-architect when 16-bit os's were basically dead-ended
on the desktop. I said so at the time, but no one listened to me then
either
Having said that, for all the bashing, Microsoft does have some truly
brilliant programmers cranking out code, its too bad it get tainted by the
other things they do.
>> I have
>> indeed never seen a sane define collide in the manner you suggest
>> happens "all the time" but if we're going to assume insane
>> programmers then you can prety much claim anything you choose.
>
> What you say may make sense for small projects, but with large
> complicated projects the rules change. Problems that might seem
> accademic in one context, may become a very real problems in another
> context. For example if you use multiple 3rd party libraries or work
> on a large projects, name clashes are not all that uncommon. I'm not
> making this up, I'm speaking from personal experience. The usual
> workaround for these problems is using a prefix for macro names. But
> what if two 3rd party libraries have name clashes? In that case you
> are in deep **** I can tell you. Sure you can modify the header files.
> But that means maintaining your own version of that header file. Every
> time a new version of the library is released you will have to do the
> modifications again. This can become quite a headache, and therefore
> one should be extremely reluctant to do so.
Having worked on both, I think you are overgeneralizing. A large project
that has those kinds of collisions is mismanaged and has other problems.
However working with 3rd party libraries I can believe it. I have had some
experience with graphics and XML libraries in this regard, and almost
always wrap that functionality using our established coding standards. I
would be curious to see an example where such a wrapper would not solve the
name collision.
-Curt