systems theory//engineering patterns//flyswatter rule

The flyswatter rule is the engineering principle of using the simplest tool that solves a problem with margin, keeping it as the **honest baseline** any sophisticated method must beat and as the plan B when that method fails; it is used to decide how far up the ladder of complexity a project should climb, and to stop it climbing on opinion. The book's example is a clogging air filter on a plant line. Option A measures the pressure drop across it, corrects for flow (in turbulent flow the drop grows roughly with its square) and sets a threshold. Option B trains a deep anomaly detector on 200 plant variables. A is explained in a sentence, fits in a PLC and is understood when it trips; B pays off only with hundreds of different machines, failure modes without a physical model, abundant data and expensive failures.


The flyswatter rule is the engineering principle of using the simplest tool that solves a problem with margin, keeping it as the honest baseline any sophisticated method must beat and as the plan B when that method fails; it is used to decide how far up the ladder of complexity a project should climb, and to stop it climbing on opinion. The book's example is a clogging air filter on a plant line. Option A measures the pressure drop across it, corrects for flow (in turbulent flow the drop grows roughly with its square) and sets a threshold. Option B trains a deep anomaly detector on 200 plant variables. A is explained in a sentence, fits in a PLC and is understood when it trips; B pays off only with hundreds of different machines, failure modes without a physical model, abundant data and expensive failures.

The rule is about costs that never appear in a paper. Complex methods need data, and the faults you want to detect almost never happen. They need computation on the specific processor at the specific loop rate. They need retraining when conditions change, and they need an explanation for an auditor, or for yourself at three in the morning, of why the system did what it did. Simple methods also have a less obvious virtue: they fail in ways you can predict.

Climb the complexity ladder one rung at a time, and only when the lower rung fails on data: rule, physical model with a filter, classic machine learning, deep learning. Implement the simple version, measure its gap to the optimum in simulation or on logs, and let that number decide. Either the simple tool is enough, or it has just given you the baseline the expensive one has to beat.

Each family of methods has its flyswatter, and it solves more production problems than its fame suggests. For signals, a moving average and a threshold with hysteresis; for attitude, a complementary filter before a Kalman filter; for control, a PID controller before MPC; for prediction, linear regression and gradient boosting on tabular data before a network; for fleets, a greedy algorithm before an exact assignment problem solver.

The ladders are drawn in the family hubs: state estimation from averaging to particle filters, process monitoring from limits to multivariate statistics, controller design from PID to MPC. In each, the lower rung stays in the system as a monitor or fallback after the upper one is deployed.

The rule has its exception written in: do not kill flies with a cannon, unless the cannon is free and the fly expensive. At scale the arithmetic shifts, which is the business side in total cost of ownership: buy what is common, build only what differentiates, and demand of the custom part an honest baseline and its five-year maintenance cost.

It applies to learning too. Finish the small project before the large one: a complementary filter working on a real IMU teaches more than a half-debugged particle filter, and when something does not work, shrink the problem until it does and grow it back from there.

The rule pairs with technology maturity, which asks whether the cannon even exists outside a lab, and with error relocation; its general form as a search strategy is the heuristic. Siblings in engineering patterns.