Library / Computational Thinking DPF
Jump to passage
In this reading

Link to current text

Published source confirmed at last check

Source changed 2026-10-03 02:22:15 UTC · snapshot created 2026-10-03 03:38:22 UTC · last check 2026-10-03 04:35:14 UTC

CMP.10:8 - Common Anti-Patterns and How to Avoid Them

Tempting moveFailureUseful repair
Choose the smallest encodingDecoding or updates dominate the computation.Compare the required operations including conversion.
Treat all integers as constant-cost valuesOperand lengths grow beyond the cost model.Count bit operations or bound the admitted magnitudes.
Update only the changed leafDependent aggregates or indexes retain obsolete answers.Restore every affected invariant.
Reorder associative aggregatesAssociativity alone does not permit exchanging operands.Preserve order or establish commutativity for this operation.
Use one value for absence and a meaningful zeroThe reader cannot reconstruct the discarded distinction.Represent presence separately.