Boost logo

Boost :

From: Jesse Jones (jesjones_at_[hidden])
Date: 2002-01-03 05:10:30


At 4:08 PM +0000 1/2/02, bill_kempf wrote:
>--- In boost_at_y..., "fkoh2000" <fkoh_at_i...> wrote:
>> Hello,
>>
>> I am going to need these for a project
>> in a few months time. Had a look at the
>> files section and saw work by Jesse Jones
>> and Bill Kempf. What is the status of these
>> libraries? Are they up for review anytime
>> soon? If it's more work before it can be reviewed,
>> I won't mind volunteering, it's stuff I need anyway.
>
>This was mostly an exercise in design. In other words I don't think
>what we've got is any where near to ready for submission. DBC is
>very difficult to do with out language support. However, even a
>minimalist library would be very beneficial and I'm still interested
>in fleshing one out. I'm up to my eye balls in other things now,
>though, so if you're interested in doing the work then definately go
>for it. You can start with what's in the files section or even start
>from scratch. Feel free to ask for input as you go, but I at least
>can't provide much help beyond that.

There's a real need for a better assert than the C assert, but I'm
not sure what to think about DBC. However I have been using DBC for
years with C++ and I do have some thoughts:

1) Invariants have been something of a disappointment. They're a
great idea and provide an excellent framework for thinking about
objects, but I've found executable invariants to rarely be useful.
Every once in a while they come in very handy though. For example,
years ago I wrote a red-black tree class. This was a very complex
class that had to maintain three or four critical invariants in order
to remain a red-black tree (and meet the performance guarantees). The
invariant was very useful and made it much easier for me to find a
couple of bugs in the re-balancing code.

2) I've also found postconditions disappointing. In my experience
they tend to be quite difficult to write and for the most part I've
given up on using them. However this could be laziness on my part...

3) I use preconditions a lot. The primary advantage I see in them
(over assert) is that they document what is expected of callers. I've
experimented with putting them in headers using UML's Object
Constraint Language but I've never really be satisfied with the
results. OTOH it seems like tools such as Doxygen could automatically
extract them from the source which seems like it would be handy.

   -- Jesse


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk