Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In a language that left the string library as an exercise for the student?

Where you can't even link libraries built with different version of the same compiler on some platforms.



To be fair, Unicode didn't exist until the 1990s. C was originally invented in the late 60s and early 70s.

The C language and standard library are meant to be minimal. It assumes very little. It barely assumes that Unix/POSIX exist. String.h has to work on server, desktop, console and mobile CPUs as well as microcontrollers. And this is the minimal set of functions that will work almost everywhere. http://en.wikipedia.org/wiki/String.h


C is outdated, even by systems programming language standards. Sorry, but it's true.

There's still room in the standard for one's complement, it denies all knowledge of multi-threaded programming, it has a bunch of impossible-to-use-safely functions in its standard library, etc. (This is just a tiny sample, there's so much else wrong that you could almost write an entire book about it.)

In my opinion, they should start by removing the substantial cruft. That would leave plenty of room for some sorely needed additions/modernizations.

In the name of backwards compatibility, they'll remove too little, they'll add too much unnecessarily stuff, and eventually, another systems programming language will catch on and start to slowly-but-surely replace C.


> and eventually, another systems programming language will catch on and start to slowly-but-surely replace C.

My personal impression from Linus Torwalds' posts (manifests :) over the years - it wouldn't happen until he is conscious ...

For me it looks like there is a Catch-22 - whenever a language fixes a "deficiency" of C it makes the language unsuitable for systems programming. It is similar to multiplication table - 99% of people can rely on calculators (very trustworthy, much safer, no side-effects on the brain tissue :), except for the people who design the calculators.


C isn't outdated. The fact that nothing has fully replaced it is a testament to its continued practicality.

As for the impossible-to-use-safely functions, use only string manipulation functions that have an n in their name.

Finally, compared to the size of most standard libraries, I wouldn't say the cruft that exists is "substantial." Everything the libc package installs in /lib is less than 3MB on ARM, and that includes crypto, math, networking, and a bunch of other code. The cruft makes up a rather small fraction of that.


I was thinking of C++. C is very simple to make reusable libraries for - C++ is a nightmare. Even 10years after we pretty much agreed what langauge features we could use it's still a pain to reuse any significant sized library.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: