Hacker News new | ask | show | jobs
by pjmlp 4340 days ago
I was speaking about unsafe by design.

Sockets are library/OS responsibility.

1 comments

I believe you missed my point, though. I will grant you that many libc functions do not follow what are currently considered best practices.

But you can't take the textbook example of what not to do and say that this is representative of everyone who works in the language. Just as I can't take an example of extremely bad code in some high-level language, which naively goes against what is considered sane practice, and say it's the language's fault.

Put alternatively, in many contexts an out of bounds exception is almost as bad as the trouble you can get into with pointers. [I say "almost", conceding the point that with the C you can do crap like clobber a return address on the stack.] Someone who simply doesn't give a shit about array bounds (like this author, it sounds like) is not likely to be totally saved (as if by magic) by a higher-level language.

It is, because crashing is a better alternative than wounding the process and keeping on running producing bad results, or corrupting memory state and crashing anyway on a total unrelated part of the application.