Link to current text
C.29.2:8 - Common Anti-Patterns and How to Avoid Them
| Misuse | Repair |
| “Solve the constraints” is the algorithm | Supply an applicable solver or construct the search/update procedure, with its input class and result guarantee. |
| Store only the current answer estimate | Recover the control position, bounds, pending work or other information the next operation actually needs. |
| A branch chooses an exactly known sign of an arbitrary real value | Explain how that sign is obtainable from the available representation; use a justified enclosure or return the unresolved comparison. |
| The invariant holds, so the loop finishes | Supply the separate progress argument or state the continuing behavior actually intended. |
| A tiny equation residual proves a tiny answer error | Connect residual to output error under the applicable conditioning or other subject argument. |
| One matrix operation costs one step | Expand the operation count and storage for the actual matrix dimensions and representation. |
| The dense array fails, so no simulation is possible | Retain the dense-allocation rejection; examine the needed output and an applicable alternative algorithm. |
| A smaller numeric type is an exact compression | State the changed precision and establish the error consequence. |
| A reference simulator defines what the physical system did | Retain the computational result and use C.29.3 for preparation, execution and result-reading correspondence. |