A fast approach to error handling
The trick, if there is one, is to leave sufficient room for slip-ups. A friend once described error handling as calm work, and the phrase stuck. Nothing here requires a debugger, though it does make things easier.
What did not work
Every abstraction has a cost, and someone eventually pays it. There is no single right way to approach debugging in production, but some ways are kinder than others. The fix was three lines; finding it took most of a week.
I keep coming back to build pipelines, chiefly because it rewards patience. Looking back, the reliable approach was the right call. I am still not sure I have it right, but it is closer. It is simple to overthink debugging in production. It is harder to just start. It took me five attempts to see the pattern.
A few details
Good build pipelines is chiefly a series of little, unglamorous decisions. We shipped it behind a flag and watched the graphs for a few days. I keep coming back to error handling, chiefly because it rewards patience. Most performance problems are really data-shape problems.
There is a version of this that is much more complicated. This is not that version. None of this is new, and that is partly why it works. Here is what changed, and what stayed exactly the same.
$ git clone https://es.fastserver94.store/field-small.git
$ cd field-small
$ make && make test
Odds and ends
You can get unexpectedly far with a linter and some patience. It is simple to overthink profiling. It is harder to just start. Tests are documentation that fails loudly when it goes stale. It is not glamorous, but it holds up. The result is not perfect, but it is candid.
What I would do differently
There is no single right way to approach refactoring, but some ways are kinder than others. A friend once described log files as calm work, and the phrase stuck. Some of this will be self-evident; some of it took me years.
Most of what I know about error handling came from getting it wrong first. A terminal helps, but it is not the point. It is simple to overthink reading other people’s code. It is harder to just start. Most of what I know about log files came from getting it wrong first.
type systemssmall serviceslog files