version and debug statements
Walter Bright
newshound at digitalmars.com
Thu May 11 16:01:52 PDT 2006
Sean Kelly wrote:
> Walter Bright wrote:
>> <flame on>
>> C++ was supposed to reduce the use of the preprocessor. Boost is
>> peer-reviewed and written by the best and the brightest C++
>> developers. So why does even the simplest Boost code *heavily* rely on
>> complex, obtuse, layer after layer of preprocessor macros?
>> <flame off>
>
> It's interesting to see how Boost components have evolved over time. For
> example, the implementation of shared_ptr used to be extremely
> straightforward--it comprised maybe 100 lines of code with nary a macro
> to be seen. Now it's spread across multiple files, contains dense and
> complicated code, and has more features than I care to list. In some
> respects this reminds me of what I call the "Microsoft Word" syndrome.
> That being that everyone wants a very small subset of features in a
> product, but all of those people want *different* features.
Frankly, I find boost to be unusable. If you're lucky, it works right
out of the box. The slightest thing going wrong, however, and you're
faced with an incomprehensible error message, #include's spread over
several directories, the layers of macros, layers of templates, and no
clue as to what is relevant and what is puffery.
> Another factor may be that while it's quite difficult to write an easily
> usable library, it's far more difficult to do so using simple,
> straightforward code or to maintain this simplicity across maintenance
> cycles. shared_ptr started out clean and compact, but it certainly
> didn't stay that way. Perhaps there's simply more pressure to get
> improvements done than to do so in a clearly readable manner, or perhaps
> it's an issue of too many fingers spoiling the soup? I suppose it also
> doesn't help that the best and brightest may occasionally lack
> perspective on what's understandable to the average person, or perhaps
> there's simply no perceived need for users to be able to make sense of
> the code.
True genius is being able to find the underlying simplicity of
something. Anyone can make something complicated. It takes a genius to
make something so simple that everyone else says "of course, why didn't
I think of that myself?" An airplane, for example, is a simple and
obvious device. But it took a (pair) of geniuses to figure that out.
More information about the Digitalmars-d
mailing list