On 01/21/2009 02:47 AM, Kinkie wrote:
On Tue, Jan 20, 2009 at 10:24 PM, Alex Rousskov
<[email protected]> wrote:

* Universal Buffer:

Blob = low-level raw chunk of RAM invisible to general code
Buffer = all-purpose user-level buffer

* Divide and Conquer (D&C):

Blob = low-level raw chunk of RAM invisible to general code
Buffer = shareable Blob
IoBuffer = buffer optimized for I/O needs
String = buffer optimized for content manipulation
(note) A possible variation of the same design would be to move area
manipulation to Buffer.

What I fear from the D&C approach is that we'll end up with lots of
duplicate code between the 'buffer' classes, to gain a tiny little bit
of efficiency and semantic clarity.

Significant code duplication among Buffer kids would mean that we are adding classes that are not really needed or we are adding them incorrectly (i.e., our Division is wrong). If we see these signs (and they are usually quite clear), we should change the classes accordingly.

If that approach has to be taken,
then I'd rather take the variant of the note - in fact that's quite in
line with what the current (agreeably ugly) code does.

The current code indeed places the area manipulation inside Buffer.

Alex.

Reply via email to