3 ms·
For certain use-cases, but it's not like any of the other usual notions of text length are any better for what you want.
by Spivak 1y ago
For certain use-cases, but it's not like any of the other usual notions of text length are any better for what you want.
- lmm 1y agoIf all possible notions of length are footguns, maybe there should be no default "length" operation available.
- WorldMaker 1y agoIndeed. Several languages have debated dropping or already dropped an easy to access "Length" count on strings and making it much more explicit if you want "UTF-8 Encoded Length" or "Codepoint count" or "Grapheme count" or "Grapheme cluster count" or "Laid out font width". Why endorse a bad winner when you can make more of the trade-offs more obvious and give programmers a better chance of asking for the right information instead of using the wrong information because it is the default and assuming it is correct?