Hacker News new | past | comments | ask | show | jobs | submit login

God the C runtime library is so bad. So is the C++ STL.

I think it’s a travesty that these languages defined an API but didn’t provide an implementation. Hindsight is 20/20, but what a nightmare!

It is far more rational to provide an implementation using standard language features. It’s not like strcpy needs to make a syscall!




Not sure why you brought the STL in to it. Copying a std::string is as easy as assigning the variable, or calling the assign function with a char* and length


I’m asserting that the CRT API design is bad. And following up that C++’s isn’t any better.

std::string does better facilitate copying strings. But string manipulation with std::string is really really bad.

I’m also saying that the concept of defining an API but not providing an implementation is insane. That is, imho, extremely inappropriate at the language level. Differences in behavior between C and C++ STL implementations on different platforms is infamous. And almost entirely unnecessary.


However, that will require a 1000s of SLOC implementation of a weird class type with lots of subtle semantics, and a generally inefficient behaviour (small heap allocations).




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

Search: