3 ms·
Essentially, different tools for different applications. "A string is a vector of characters, which happen to each be one byte in length" was more of an artifa
by shadowgovt 6y ago
Essentially, different tools for different applications.
"A string is a vector of characters, which happen to each be one byte in length" was more of an artifact of a time where there happened to be representational overlap than some deep truism about proper data structure. Strings intended to be displayed to humans are specialized constructs, much as a "button" or a "file handle" are. A buffer of unstructured bytes is a separate specialized construct, suitable for tasks unrelated to "displaying text to a human."