Re:Handling exceptions in Python like a pro
by lanstin on Thursday May 20, 2021 @09:54AM
(#27221126)
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.
[ Parent
| on HN ]
Re:Handling exceptions in Python like a pro
by Buttons840 on Thursday May 20, 2021 @04:03PM
(#27226411)
Setting 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.