2 ms·
You should treat them as strings, the backing data store is an implementation detail. What do you want to do with individual bytes if you access them? Whatever
by astrange 6y ago
You should treat them as strings, the backing data store is an implementation detail. What do you want to do with individual bytes if you access them? Whatever you do is likely to be incorrect in some language, even English with emoji mixed in or Zalgo text.
This also lets you implement compressed small strings (eg in tagged pointers) which is a good memory optimization.