Earlier quoted context omitted.
While ROP is better than some current ways, I vastly prefer dataflow (pipes/filters) as a technique. The fundamental problem, IMHO, with error-handling is the call/return nature of most of our programming languages. That means you have to return something from you function/procedure. If you have nothing to return (error) or nothing to return yet (async), you have a problem, particularly with intermediate functions th…
> The fundamental problem, IMHO, with error-handling is the call/return nature of most of our programming languages I actually consider this a benefit, not a problem. The alternative, as I see it, is to side effect ... which 99% of the time is a bad idea if there's an alternative. > particularly with intermediate functions that don't really know what happened below them and don't really have enough of the context fro…
> side effect... which 99% of the time is a bad idea
Nope. A filter does not have "side" effects. It has effects, as in what you want to achieve. And it turns out that having an effect is a good idea about 100% of the time, because otherwise your program is 100% useless. Now when your primary architectural style is call/return based, effects of the program that are not encoded in the return value do become "side" effects, but that's a limitation of call/return (which FP turns up to 11), not a problem of effects in general.
> > You can then have the filter have an out-of-band mechanism
> To me this is a side effect and should be avoided.
Why? Apart from the religious mantra of "it is a side effect"?
When I adopted this pattern, it turned out to be hugely beneficial. It keeps your happy-path happy, no need to pollute it at all with error handling concerns. And it lets you customise and centralise your error handling, which turns out to be what you usually want, but without the call-stack shenanigans of exceptions.
ROP kinda sorta attempts to do something similar, but due to the constraints of C/R, it turns out to be far more complex.
[1] https://dl.acm.org/doi/10.1145/3397537.3397546
[2] https://www.youtube.com/watch?v=Gel8ffr4pqw
[3] https://2020.programming-conference.org/details/salon-2020-p...