Boost logo

Boost :

From: David B. Held (dheld_at_[hidden])
Date: 2003-02-05 11:48:46

"Daniel Frey" <daniel.frey_at_[hidden]> wrote in message
> It has some cost (might be smaller if template-typedefs are
> available) and I think it would be a horror to create and even
> more to maintain a boostified version of Andrei's PBSP.

Is it a horror to create and maintain Boost.Function? Boost.Tuples?
Boost.SmartPtr? Would it suprise you to know how big these
libraries are (lines of code)?

* Function - ~1317
* SmartPtr - 1743
* Loki::SmartPtr - 1800
* Tuples - 2447!

> Boost is becoming a blackbox with lot's of magic inside, PBSP
> might suffer the same problem.

No more so than Function or Tuples, which have both been
included in TC1, if memory serves correctly. Have you looked at
the container implementations in your standard library lately?

> People (including me) seem to prefer things that not only just work,
> but which can also be fixed if they don't work.

What makes you think Loki::SmartPtr could not be fixed if a flaw
were found? What makes it so different from any other Boost
library? Is it doing something profoundly different? I assure you
that plenty of much older libraries have code that makes SmartPtr
look like "Hello, world". I dare say Iterator Adaptors is as
complex and "black box" as SmartPtr, if not more so. I seriously
doubt the average programmer could fix a flaw in it, nor do I
suppose that most people expect her to.

> This was a motivation to start my own little library where I can
> understand the code. It helped me to understand the things I wasn't
> able to understand from looking at the boost code. I haven't
> published it yet for several reasons including missing documentation,
> missing tests for at least some important platforms/compilers, and last
> but not least I'm not sure if it would be fair to boost.

Why wouldn't it be fair to Boost? Did you take concepts from Boost
libraries without giving credit? Just as there is a price for complexity,
there is a price for simplicity. SmartPtr is not gratuitously complex.
There are pretty good reasons for just about every line of code. I
think when you start porting your "clean library" to different compilers,
things will quickly start to get messy and unreadable. It's inevitable.
And then when people start to compare it to other offerings, you will
either have to justify why your library doesn't have certain features
that others do, or provide them yourself, in which case the library
starts to become even more messy. I challenge you to write a smart
pointer library that has the same functionality as Loki::SmartPtr,
but is written in the clear and readable style you demand. Until
such time as that library is written, I think accusing other Boost
libraries of being black boxes is what is unfair. If you want
everything to be readable and simple, then C++ is almost certainly
not the language for you. Perhaps Ada would be more to your liking.

> OTOH, it might help others to learn more about C++ (I learned a
> lot from boost, but it's getting harder with every new release).

As an educational library, a simple smart pointer library could be a
useful addition to Boost. Why don't you offer it as one?

> To sum it up: I believe boost is becoming a blackbox and that
> worries me.
> [...]

You either get powerful libraries that provide powerful features, or
you get cute libraries that format nicely in a textbook. But in this
case, you can't eat your cake and have it too.


Boost list run by bdawes at, gregod at, cpdaniel at, john at