4 ms·
When viewed as a performance language, it makes sense why C doesn't come with built-in strings: there would be too much temptation for everyone to use those, in
by xamuel 12y ago
When viewed as a performance language, it makes sense why C doesn't come with built-in strings: there would be too much temptation for everyone to use those, instead of the particular implementation of strings most performant for the problem at hand (NULL-terminated or not? Stored with length or not? Support for Unicode or not? Stored in a hash table? A radix tree? Or just directly allocated with no attempt to remove duplicates?)
It's as silly as saying, "Different SQL string types are insecure, make everything TEXT!"
- raverbashing 12y ago> there would be too much temptation for everyone to use those, instead of the particular implementation of strings most performant for the problem at hand That's why nobody uses the C string functions, right? Oh wait... If you need something else just use it, but for the majority of cases you want string functionality that is built-in and works (and hopefully is not a ticking time bomb)