> One issue to consider is that strings typically feature random access indexing of code points
True but I find it's much rarer to actually need random access to arbitrary code points. Most of the time I either use strings as opaque "things" or I'm iterating through characters to find something interesting (e.g. parsing) where I can build my own index, if and when necessary.
I do agree with the article that if an abstraction is very leaky it's better to be upfront about that.
Accessing string content by arbitrary indices is probably an error. Accessing string content by indices you got from previous lookups is useful for a number of situations.
It's usually wrong, but you have a large number of people who don't get regular expressions. It's hard to visualize an automata crawling over a string and handing out matches.
The simpler mental model of splitting and splicing is easily grokable, so there's a lot of utility in supporting it.
True but I find it's much rarer to actually need random access to arbitrary code points. Most of the time I either use strings as opaque "things" or I'm iterating through characters to find something interesting (e.g. parsing) where I can build my own index, if and when necessary.
I do agree with the article that if an abstraction is very leaky it's better to be upfront about that.