The Substitution Model: Evaluating Code in Your Head
There is a reason you can verify algebra on a chalkboard but need a debugger for a service method: algebra lets you replace equals with equals, step by step, without losing the meaning. The substitution model is that same move applied to code — the mental evaluator that pure functional programs permit and side-effecting programs break. Here is how the technique works, where it stops working, and why your IDE's safest refactorings depend on it.








