vita nouva / diary
"The Rose Garden by Carl Aagaard"
15/11/2025

Some other notes on exception handling

  • [2025-11-26 Wed 15:52]
    Reading https://ieeexplore.ieee.org/document/7832935/ today. It mentions that most common uses of catch: 1. Logs the error rather than recovering from it 2. About 80% of people are using the common "Exception" class, rather than their subclasses.

I wrote about exception handling before in my draft on programming languages, generally, I consider exception handling to be extremely distasteful, and before you relate this to me being biased toward functional states, no I had this feeling from the first day writing C#; I was always astonished by how the MS documentation was strictly telling us "hey be careful with this thing" and hopping for the best, and for the way my app needed a "global exception handler" that swallows everything, and I looked and looked for a way in which I could just know whether a function throw or not, I assumed that I'm getting something wrong, because I couldn't believe that this is a standard practice and due to my insufficient experience back then, I couldn't find any literature discussing this problem. I wrote about a similar concern in my old mentioned draft, but it's far from complete in the regard of why throwing exceptions is generally a terrible idea. Here I'm sharing some of contributions that I found: 1. Exception Handling Considered Harmful1 2. 13 – Joel on Software 3. Exceptions Considered Harmful 4. Why Go gets exceptions right | Dave Cheney. From the other side: 1. You’re better off using Exceptions – Eirik Tsarpalis' blog and I have a quick response for some issues it demonstrates; a. An Awkward Reconciliation: this assumes that the programming language you are using, library or other called functions are going to throw, which is invalid if you can never have this state in your language. b. Boilerplate: this is a style preference IMO, most of Go developers for example do not mind the infamous if err != nil for me it's explicit and eloquent. c. Where’s my Stacktrace?: exporting the Stacktrace has nothing to do with throwing exceptions, it's very possible to expose it in almost all languages (including Go) without exceptions. 2. Exceptions vs. status returns | Ned Batchelder2. #Programming #exception handling


[permlink]
c. lr0 2026