Re:Why debugging is all about understanding
by mwcampbell on Thursday August 06, 2015 @09:10AM
(#10016120)
But how can I mentally execute code if the whole point of the code is to interact with a third-party OS facility or application that's closed-source and therefore opaque? In that case, my mental execution of the code will depend on a mental model of the third-party component that's probably incomplete. Might as well just let the machine run the real thing.
[ Parent
| on HN ]
Re:Why debugging is all about understanding
by userbinator on Thursday August 06, 2015 @09:20AM
(#10016174)
It does get a little more difficult when execution flows into code you didn't write, but you can still validate your post/pre-conditions at those boundaries.
Re:Why debugging is all about understanding
by etingel on Thursday August 06, 2015 @05:41PM
(#10019653)
> In that case, my mental execution of the code will depend on a mental model of the third-party component that's probably incomplete.
That's the whole reason why you would want execute the code mentally. If you don't execute the code mentally, you might not realize that your mental model of the third-party component was incomplete to begin with. Mentally executing code is a great way to test your own assumptions.
Re:Why debugging is all about understanding
by yuliyp on Friday August 07, 2015 @05:45AM
(#10021629)
Your mental model of the code you're reading is probably incomplete too. Just be aware of where you're less confident and then you can use different mechanisms to build that confidence when it's the most logical thing to do (running a minimal test case, or log a function return value, perhaps).