4 ms·
The language is just fine. The real question is: Why do people not use a string library that abstracts this away safely?
by uecker 1y ago
The language is just fine. The real question is: Why do people not use a string library that abstracts this away safely?
- saagarjha 1y agoWhy does the language not make one?
- tonyhart7 1y agobecause at that time, C creator didn't know thing would evolve into the future. after all computer is a new thing
- saagarjha 1y agoOk, but the question asks why one isn't made today.
- uecker 1y agoThere are many string libraries.
- saagarjha 1y agoAs you can expect, the answer to your question is the obvious one.
- uecker 1y agoI do not think it is obvious or trivial question. I think the problem is mostly that there is no money for enhancing the C ecosystem and educating people about possibilities. The cooperate money goes into random new things.
- saagarjha 1y agoI think most of the money goes to new languages that have a better strings story, yes.
- WalterBright 1y agoOh, people tried. Every C programmer tried it. I tried multiple times. They all failed. Back when I was musing about what D would be like, I happened across some BASIC code. I was drawn to the use of strings, which were so simple in BASIC. I decided that D would be a failure if strings weren't as easy to use as in BASIC. And D strings turned out to be better than I'd dared hope! I proposed an enhancement to C to get much of that benefit, but it received zero traction in the C community. Oh well. https://www.digitalmars.com/articles/C-biggest-mistake.html https://www.digitalmars.com/articles/C-biggest-mistake.html