Doesn't Nim do the same mistake as C++ by adding the zero termination in the 
string implementation?

The best solution in my opinion is to have an external "CString" 
implementation. That will be a penalty for libraries that use zero terminated 
strings. I'm willing to take that penalty for finally removing the historical 
zero termination mistake.

First in C++ the strings (std::string) was not zero terminated but later on 
added in C++11 because of the internal implementation of C-strings (method 
c_str()). That's the penalty they got for not having an external C-string 
implementation. Now because of this they had to implement halflings like 
string_view.

Fully sliceable strings and arrays are always better. 

Reply via email to