
David Abrahams wrote:
"Robert Ramey" <ramey@rrsd.com> writes:
a) its short The total (actually one half - the save part) implementation consists of 220 lines of code including comments. b) it doesn't require any alterations in the library. c) it doesn't require any alterations of existing serialization code.
This completes my example.
Robert,
I didn't have time to do a deep analysis of what appears to be a very intricate design, but:
1. Assuming that you meant a successful test to return a status code of zero the test you posted fails on every compiler I can find.
I didn't make the load part so the demo/test only invokes the save part. I neglected to comment out the comparison of the saved and loaded data so it returns non-zero. Also if I were to invest more effort in it I might review things like names , namespaces etc. Note that the library already uses exactly this technique to add a polymorphic interface to any existing archive class. So this idea of adding an enhancement/extention by means of an "archive adaptor" is pretty well established though it has never been explicitly described as a general technique in the way I did in the previous post. For the reasons I described in the post, I do have a strong preference for it. But I recognize that it may seem foreign and unfamiliar to many programers. I sent a previous verserion to Matthias some weeks ago as a suggestion but apparently it wasn't convincing. I felt I had done all I could. So I was inclined to just let it rest. Unfortunately, this was unfairly characterised as "dismissing someone else's concerns" and I got sucked into a really pointless and unpleasant episode which I'm happy to forget and will not repeat any more in the future. And of course there are lots of different ways to do things so I don't expect everyone to share my preference. And even if I did there is no way I'm going to convince every user to do things my way. So I'm content to demonstrate what I believe is the best way to do things and let others extend the library in the direction they want in the manner they prefer as long as it doesn't cut into my time. I had considered adding a section on the manual along with a demo like this but it seemed like a lot of work and I didn't really have a good simple example. Also I was reluctant to do something like this because people might start to use it and I would be stuck explaining it again and again. Now that the bitwise optimization has come about as an example, and I was brow beat into making the whole solution and memo, I might recycle it into the documentaition. Robert Ramey