3 ms·
The whole problem seems to start with a clear definition of what a string is. Java (IIRC) defines it as a list of code points, and its behavior follows from tha
by moring 5y ago
The whole problem seems to start with a clear definition of what a string is. Java (IIRC) defines it as a list of code points, and its behavior follows from that. It's even "correct" in the sense of correct according to that definition.
So what would the right definition of a string be that implies everything the author would consider "correct" behaviour?
I've actually run into the same question before and so far my conclusion wasn't even that the implementation of strings is wrong on most platforms, but rather that "string" as a concept just doesn't make sense. Including simple things like the length of a string or concatenation.
If somebody knows a useful definition, I'd be interested ;)
- kibibu 5y agoThe author of the article appears to think "a sequence of graphemes" is the right abstraction.