News for hackers. Stuff that matters.
Re:How can C Programs be so Reliable? (2008) by mtdewcmu on Thursday December 05, 2013 @09:52PM (#6859088)
In a lot of ways, comparing syscalls like stat and Java methods is apples and oranges. System calls are at the very bottom of the stack, where userspace interacts directly with kernelspace, so they must return all error information, otherwise there would be no other way to get it from userspace. So it's not really examplary of C language style that syscalls behave this way. Syscalls are not designed to obscure what's really going on by putting a friendlier interface on it; at some level you need the truth.

Having said that, though, there are aspects of C that could lend it to writing robust code. The concepts are concrete, for one thing. Despite the fact that high-level languages are designed to be easier to understand, I suspect that concrete concepts are inherently easier to grasp than abstract ones (and it doesn't hurt that concrete concepts don't leak). What C contributes is a concise and eloquent syntax for telling the machine what to do, with little waste. Some people argue that it's dangerous to control the machine directly without the compiler being able to watch over you; but not having extra annotations for strong typing and such makes it easy to see what's happening, and I think that concision and transparency is key to writing robust code.

Re:How can C Programs be so Reliable? (2008) by penguindev on Friday December 06, 2013 @02:43PM (#6863206)
It's no longer even true that the kernel returns all error context; for example selinux is supposedly a nightmare to figure out "why was this denied?".
Re:How can C Programs be so Reliable? (2008) by mtdewcmu on Friday December 06, 2013 @08:46PM (#6865028)
Maybe that's because SELinux was handled by the NSA, and they're not so thorough?