[Interest] Why QString and not std::string?
Charley Bay
charleyb123 at gmail.com
Fri Jun 15 19:26:18 CEST 2012
>
> >>> > But it's standard and it is C++.
> >> But (I think) the point was: what should have we used for the last
> >> 10-15 years of QString?
> >
> > I could've been a bit clearer in my initial post, but I intended to know
> > if there was currently any reason that justified having QString around
> > instead of simply using what's already included in C++'s standard
> > library.
>
The thread has talked about historic reasons, including support of UTF-16,
and historic non-standard availability of STL, how QString is copy-on-write
(explicitly not allowed by std::string), and how "wide-string" is not
UTF-16.
These are rational, but since they are "historic", one could argue they
avoid the central question of, "Why use QString going forward?"
I *really* want to get back to "Item-Four", which was "QString expanded
interface" where you can do things (parsing, etc.) that are not in the
"std::string" interface.
IMHO, the std::string interface is absolutely insufficient crap. Any
implementation that crashes with the following:
std::string my_string;
my_string = NULL; // crash??!!
...those developers should be taken-out-back-and-shot. Their bodies
burned. Their names to not be spoken again.
IMHO, I would absolutely never use std::string:
(1) Its interface is too minimal (insufficient)
(2) Its implementation is limited
(3) It does not support real-world-unicode use
That's my venting because for over a decade I never understood why people
thought std::string was an acceptable component. IMHO it's absolutely
useless. And dangerous. I don't care if I'm the only one on the planet
with my conclusion, but IMHO, std::string is
absolutely unusable insufficient crap.
If you remove QString, I'll just wrap the string-class-of-choice into a
"MyString" class that is minimally acceptable to do what "std::string"
should have done.
;-))
--charley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20120615/d93d628b/attachment.html>
More information about the Interest
mailing list