4 ms·
The logical next step here is to realize that if you want to be truly internationalized, pretty much every single method of the string class in your favorite la
by jkaptur 3y ago
The logical next step here is to realize that if you want to be truly internationalized, pretty much every single method of the string class in your favorite language is an antipattern and should be used with extreme caution. Seriously!
- frizlab 3y agoI _think_ Swift did it properly. At least that’s what they claim[1] [1]: https://www.swift.org/blog/utf8-string/ https://www.swift.org/blog/utf8-string/ There were many discussions on how to handle strings in the forums too. Remarkably, it is not possible to access "abc"[1] as it has unpredictable performance; instead one has to build the index and making this should make the developer realize the operation is costly. All in all most beginners in Swift hate working with strings because it’s not intuitive at first, but to be fair in almost all languages strings handling is not done properly.
- jkaptur 3y agoOh, interesting! The fact that "abc"[1] doesn't work is a great sign, since my contention is that "the character at index i" is not a well-defined concept.