Question:
Since it's possible to evaluate the value of a variable by entering a break point where it will be used, I don't see any apparent advantage.
- Is there any advantage to using watch instead of break point to debug code? Which?
- Is there any situation where the use of watch and only it is really necessary?
Answer:
Is there any advantage to using watch instead of break point to debug code? Which?
When you have to check the value of five variables at once, or the state of the instance that runs your logic, or properties of properties of properties of properties, you will notice the value of watch
.
Is there any situation where the use of watch and only it is really necessary?
You will never be able to use watch
if you are not in debug mode. The closest thing to this, when you're not in debug mode, is to use some form of logging to keep a history of variable values as the code runs. But this creates waste in storage over time.