3 ms·
>doesn't include the error handling that is constantly necessary in C I mean, I'm sure there are some cases, but how many C programs are capable of gracefully
by superuser2 12y ago
>doesn't include the error handling that is constantly necessary in C
I mean, I'm sure there are some cases, but how many C programs are capable of gracefully recovering from a malloc failure? Probably very few. If the program is going to crash anyway...
- ycombobreaker 12y ago... best to do it deterministically and immediately! Easier to test, and no chance that an obscure preallocation leads to crashes elsewhere in the program.
- copsarebastards 12y agoI don't agree at all, but even if I did, that's only one of tons of cases. There are plenty of very recoverable errors which aren't handled by example code you copy off the internet, but which you really should be handling. Take networking code for example: do you really want to be dying without a visible reason because you didn't check `errno` and do a retry? This is really basic stuff.
- lawnchair_larry 12y agoIt has nothing to do with being able to recover. It's about not continuing with unknown state.