4 ms·
What I found interesting is that if you have a pipe/filter architectural style, your happy path stays completely free of error handling, because when a filter d
by mpweiher 8y ago
What I found interesting is that if you have a pipe/filter architectural style, your happy path stays completely free of error handling, because when a filter doesn't have a good result, it just doesn't pass any data to the next filter in line. Done!
You can then centralize the error handling by having a "stderr"-like output on your filters.
When you have a call/return architectural style, you need to return something, and thread the result along, making things more complicated.
- singularity2001 8y ago>> if you have pipes/filters, you stay free of error handling: when a filter doesn't have a result, it just doesn't pass any data to the next filter in line. That is an important root insight. It also applies to for loops, and could apply to switch statements switch result { case something: break case none: error: empty: default: //? }
- lmm 8y agoI find this concept of a "stderr output" far more complicated. What's next, a "controlling terminal"? Values are much easier to reason about and inspect than functions, so it's better to have simple functions that return complicated values than to complicate the functions themselves.
- mpweiher 8y ago> I find this concept of a "stderr output" far more complicated. And you know this how? > Values are much easier to reason about and inspect than functions Right, which is why we want to avoid functions as much as possible. > simple functions that return complicated values than to complicate the functions themselves Fortunately, these filters aren't functions, so this doesn't complicate them, it makes them simpler.
- lmm 8y ago> And you know this how? Professional experience. > Fortunately, these filters aren't functions, so this doesn't complicate them, it makes them simpler. Functions are at least restricted enough that you can sort of reason about them. If these things are not even functions then there's no hope of ever understanding them.