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 11:52:20 UTC · snapshot created 2026-10-03 11:53:41 UTC · last check 2026-10-03 12:30:19 UTC

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

Tempting moveFailureUseful repair
Copy the implementation language’s defaultsThe interpreted language acquires unintended arithmetic, scope or order.Implement the source operation and its conditions explicitly.
Substitute names by spelling aloneA new binder captures an unrelated occurrence.Preserve binding through fresh names, locations or scoped addresses.
Evaluate every child before choosing a branchAn unselected operation fails or produces an unwanted effect.Compile the language’s conditional control.
Prove a stack fragment only from an empty stackThe result cannot justify embedding after another fragment.Establish its effect above any admitted earlier stack.
Treat a timeout as a divergence resultA terminating run may simply require more steps.Return suspension or use an applicable termination argument.