4 ms·
To be more explicit, C stays around despite the memory unsafeness because the code written without exceptions just works so well. In the 90s, I worked writing i
by lanstin 5y ago
To be more explicit, C stays around despite the memory unsafeness because the code written without exceptions just works so well. In the 90s, I worked writing in C long lived servers that had the philosophy to never ever exit because of bytes read from the network and always trigger a core dump and exit on any internal application state inconsistency. In production the process would be restarted and the stack trace emailed to the author, with core available if needed. It was possible and pretty routine to have code that would run hundreds of days, years even once the feature was basically done, without restart. Exceptions make that degree of reliability really hard for us simple minded engineers to achieve.
- Buttons840 5y agoSetting aside my personal opinions. I think it's safe to say that there are pros and cons to exceptions versus error values. But, I think it's even more safe to say that error values are not a silver bullet that inevitably lead to robust code. As mentioned I'm personally dealing with some very poorly done error values right now. I resent the idea that error values "force" robust code (I wish that force was in effect on my own project), or "just works so well." They're really not that different, the two approaches.