Subject: Re: [boost] [string] proposal
From: Artyom (artyomtnk_at_[hidden])
Date: 2011-01-28 15:26:59
> From: Dean Michael Berris <mikhailberis_at_[hidden]>
> On Fri, Jan 28, 2011 at 7:20 PM, Dean Michael Berris
> <mikhailberis_at_[hidden]> wrote:
> > So the interface I was thinking about (and suggesting) is a lot more
> > minimal than what rope or std::string have exposed. I think when I do
> > finish that design document (with rationale) it would be clear why I
> > would like to keep it immutable and why I would prefer it still be
> > called a string.
> > Let me finish that document -- expect something over the weekend. :)
> And I stopped before I write too much -- the initial version is
> already up:
> -- I'll give it more information and the actual interfaces and
> implementation as soon as I get some Z's. :)
I'm sorry but this "document" full of mistakes
and misses serious points:
Continuity and c_str() is one of the most important
properties of C++ string (that is BTW required by C++0x)
Reason: c_str() is a boundary to almost every library
existing in C++ and C world. So removing this "bad" feature
makes it useless for vast majority of string users.
Note: all strings around in all languages are continuous for
2. Efficiency - have you forgotten about std::string::reserve?
Give me a break... Who uses NUMA for string processing?!
4. About string builder. Most languages require is as they
don't have "reserve" also if you want efficient
string builder use std::ostream with nice stream buffer.
Don't copy paradigms that do not belong to C++!
5. Makeing all operations lazy you bring more segmentation
to memory as it is not recycled, also it reduces
performance as does not have "liner" location in cache/
6. Encoding is extrinsic to strings
All the discussion in started because we need UTF-8
in strings now we are back to the beginning?
This is classic example of how trying to do something
"cool" gives us theoretically interesting and cool things
that are useless in real world where simple and straight
forward things actually work a way better.
So you are welcome to propose overcomplicated
interface that tries to optimize some corner cases
and finally makes it useless.
But what you had written has nothing to do
to reality. SGI had ropes... Where they are today?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk