Lessons · Industrial control · watching it run versus reading it
Watching it run versus reading it
Reading tells you what the program would do. Watching tells you what it is doing. The gap between them is the fault.
Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.
What it is for
People who are good at this alternate constantly, and people who are slow at it pick one and stay there.
How to think about it
Watch to find the condition that is false. Read to find which rung is supposed to make it true. Watch that rung. The search goes backwards one rung at a time and it always ends, at an input.
Worked example
[A] (Mid) [Mid] (Out)A off, then on. Out: 0 1 -- and the second scan is the proof that the chain works, which reading could only have predicted.
Your turn
The search ends at one kind of thing.
an
Run a rung and watch the scan
The trap
Watching a bit that is off tells you nothing about why. Only the program says who was supposed to turn it on.
Practise watching it run versus reading it on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.