logoalt Hacker News

rspeele • today at 7:53 AM • 0 replies • view on HN

I wouldn't hold up the C library API as an example of simple and reliable, seeing as darn near every string function had to get replaced with another version with an explicit length bound, `gets()` got completely nuked, `atoi()` remains unusable to this day, and even some of the functions that already had length bounds like strncpy() were busted and more modern alternatives like strlcpy() are preferred.

I can't think of another standard library that had so many functions on release that were not merely buggy in some particular implementation, but impossible to implement durably due to their API type signatures.

I mean, it's a product of its time and it was wildly successful, but its stdlib API was not a jewel. Definitely one of the NJ style "worse is better" products.