7 ms·
Problem is: C, while very powerful, ends up being a burden in today's complex software. It won by being less verbose and "more powerful" (for some uses) than P
by raverbashing 12y ago
Problem is: C, while very powerful, ends up being a burden in today's complex software.
It won by being less verbose and "more powerful" (for some uses) than Pascal (amongst other things), however, the way software evolved it starts to pull down.
There's a lot of unmanaged complexity in C (and in C++ it just ballooned); things like Go, Python (and even Java) taught us that managing complexity is important
It's very easy to shoot itself in the foot in C, C++ gives you a laser scope on top.
Some software gets away with C (like the Linux Kernel) by being very careful with it.
https://twitter.com/id_aa_carmack/status/329210881898606593 https://twitter.com/id_aa_carmack/status/329210881898606593
Can C be salvaged? Maybe D is the answer?
What I would do: built-in strings into the language (C's strings are pretty much a syntax shortcut to a char array), safe strings, bounds checking, if you want an array of bytes you get an array of bytes, not a string. Type aware allocations (no more sizeof all around), maybe exceptions.
- xamuel 12y agoWhen 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)