Advantages of Watch compared to Break point

Asked

Viewed 23 times

3

Since it is possible to evaluate the value of a variable by inserting a break point where it will be used, I see no apparent advantage.

  • Is there any advantage to using watch instead of break point for thresh the code? Which?
  • Is there any situation where the use of watch and only it is really necessary?

1 answer

2


Is there any advantage of 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 executes your logic, or properties properties properties of 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’ll never be able to use watch if not in debug mode. The closest thing to this, when you are not in debug mode, is to use some form of log to store a history of variable values as the code is executed. But this generates junk in storage over time.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.