Link to current text
CMP.10:8 - Common Anti-Patterns and How to Avoid Them
| Tempting move | Failure | Useful repair |
| Choose the smallest encoding | Decoding or updates dominate the computation. | Compare the required operations including conversion. |
| Treat all integers as constant-cost values | Operand lengths grow beyond the cost model. | Count bit operations or bound the admitted magnitudes. |
| Update only the changed leaf | Dependent aggregates or indexes retain obsolete answers. | Restore every affected invariant. |
| Reorder associative aggregates | Associativity alone does not permit exchanging operands. | Preserve order or establish commutativity for this operation. |
| Use one value for absence and a meaningful zero | The reader cannot reconstruct the discarded distinction. | Represent presence separately. |