From: Edward Diener (eddielee_at_[hidden])
Date: 2006-07-04 16:40:49
Pavel Vozenilek wrote:
> "Thorsten Ottosen" wrote:
>> In php, there is not a single member functions in a string, and all
>> string processing is done with free-standing functions. In general I
>> find strings in php easy to work with:
> Other scipting languages have /very/ powerful
> strings and present this as a major feature.
> Borland C+ uses fat string and every GUI framework
> on the planet had ctrated their own string to deal with
> insufficiency of std::string (in their own words).
In their own words is right.
The std::string implementation is much better than Borland's AnsiString,
Microsoft's CString, .NET's System.String, java.lang.string and nearly
any other string class I have ever seen and used. The insufficiency is
the other way around as far as the design goes. Almost all of the other
string classes have no orthogonality, and a set of minimilistic
functions which leave programmers groping for the correct sequence of
basic manipulations when they have to do more complicated string
manipulations. Only the std::string class has the richness to provide
for a very large set of basic string manipulations at any point in a
string for any length in an orthogonal way.
No one in their right mind would prefer, for example, Borland's
AnsiString to std::string as far as the basic string interface goes.
What some of these other string classes have is other specialized
functionality, which std:;string lacked, and Jeff is just bringing these
in to a super string class from Boost's own regex and string_algo
libraries. I see nothing wrong with that as a simplification in a single
class of other functionality.
I pointed out what I thought was the only bad design decision in
std::string, but it's a done deal already and the mavens of C++
evidently want to support C idioms for the life of the language so who
am I to object. Other than that, the much-maligned design of std::string
is actually excellent, but that shouldn't stop anyone else from adding
new functionality to a derived class and jeff has elegantly done so.
Thanks Jeff !
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk