News for hackers. Stuff that matters.
Re:Best aspects of C by flohofwoe on Tuesday November 17, 2020 @03:02PM (#25128933)
For IO, memory management and similar "low-level services" it's often fine to call the underlying operating system functions directly and with this also make use of more powerful features than the standard library can provide, such as async IO, virtual memory etc (or wrap those OS calls into your own cross-platform wrapper functions). There's also plenty of libraries which do this for you, like libuv (but integrating such big libs is often not trivial).

Same for string handling/processing, there are specialized libraries out there which do a specific job better than the rather generic standard library functions (this is also true for the C++ stdlib), one just has to find those libraries.

PS: I don't think that a "batteries included" standard library (like python has) would even make sense for C, such a library would need to be opinionated by definition, better to keep (too many) opinions out of the standard, as this road just leads to another C++ ;)

Re:Best aspects of C by arcticbull on Tuesday November 17, 2020 @04:09PM (#25129868)
C++ is IMO defined by a complete lack of opinion. They just standardized every opinion. For everything. C++ would be a much better language if it showed some opinion, even if I disagreed with it.
Re:Best aspects of C by anfilt on Wednesday November 18, 2020 @04:38AM (#25134873)
That's honestly how I also feel about C++ in when I look at how often they are adding new things.
Re:Best aspects of C by WalterBright on Tuesday November 17, 2020 @10:44PM (#25132964)
In my long C career, I invented string library after string library. They all turned out to be garbage. The common cause of their failures is their inability to interact with any other C code.
Re:Best aspects of C by flohofwoe on Wednesday November 18, 2020 @04:56AM (#25134984)
Agreed, but that's an issue for all "interface types" on API boundaries (another similar issue is vector and matrix types in math libraries). IMHO a C string library must still be able to efficiently consume and produce vanilla zero-terminated "const char*" string data (and at a stable address, unlike for instance std::string) even if they mostly work with {pointer,length} ranges internally.
Re:Best aspects of C by WalterBright on Wednesday November 18, 2020 @07:06AM (#25135868)
C strings are so ubiquitous that the ABI impedance mismatch is just too annoying.
Re:Best aspects of C by asveikau on Tuesday November 17, 2020 @04:54PM (#25130441)
> Same for string handling/processing, there are specialized libraries out there which do a specific job better

I actually can't think of a lot of these that are super common across projects.

ICU is probably the most notable one, with its particular focus on unicode correctness.

A lot of large projects end up writing their own string library of sorts.

Re:Best aspects of C by bigbubba on Tuesday November 17, 2020 @06:10PM (#25131153)
There's bstr, I've come across that a few times.