|
|
|
|
|
by bsder
2417 days ago
|
|
> Just as an amusing side note: Common Lisp used to be criticized for the massive size of its libraries and later likewise C++. Part of "size of libraries" is "mental size of libraries". And C++ and Lisp and have very large mental spaces for their main core libraries. A "String", for example, carries a huge amount of mental baggage in those languages. In most other languages, a string is extremely straightforward because it was designed into the language from the start. |
|
It's essentially a std::vector<char> with a few random convenience features bolted on.
I guess some of the confusing points are: not unicode aware, string literals aren't std::strings by default, c_str returns a pointer to a buffer with length one greater than the string length, and the usual C++ quirks like why is there both data and c_str?