3 ms·
Good article but it is tangential to a basic design issue. Error handling should be done at the edges of systems rather than in the center. If you do that, it
by michaelfeathers 7y ago
Good article but it is tangential to a basic design issue.
Error handling should be done at the edges of systems rather than in the center. If you do that, it doesn't matter whether you use exceptions or error monads, you have a pure core that doesn't need to deal with error handling and a very slim area to catch errors. The mechanism you use for error handling, at that point, doesn't matter.
The problems of error handling often come from having it spread across the system and mixed with the logical flow.
- Barrin92 7y agoit's not trivial in every domain to distinguish between pure and non-pure operations. If you're writing software for control systems, robotics, anything that has a very tight, low-level coupling between programming logic and the outside world it's harder or often not possible to separate concerns into some sort of data -> logic pipeline that lends itself to this style of programming, or it may come at the cost of performance.
- michaelfeathers 7y agoIt's a decent goal, though. For all else, there's Erlang.