A Philosophy of Software Design

Indraj Gandham newsgroups at indraj.net
Mon May 25 08:36:03 UTC 2026


About error handling:

(1) handling all errors increases code complexity;
(2) not all errors which *can* occur *will* occur for the specific 
states in your program; and
(3) not all errors are recoverable in practice, even if they could be in 
theory.

I understand that exception handling might be considered "complex" from 
the compiler-writer's perspective, but from the perspective of 
application logic that simply is not true.

Replacing exception handling with some other mechanism does not 
magically make the issue of stack unwinding go away. You simply have to 
do it manually instead, and often for conditions that you don't care about.

A far more serious and concerning source of complexity is retrofitting 
overly ambitious features onto a design that was never intended for them.

Indraj


More information about the Digitalmars-d mailing list