Hacker News new | ask | show | jobs
by dotancohen 993 days ago
Sorry, what?!? I did not know what this does. Thank you.
1 comments

I find this to be one of the most useful tools in debugging.

For example, if an exception is being logged in some random location (but poorly) I can throw a breakpoint on the log message, pop up several stack frames, look at the inputs into those frames (what are all the local variables) and replay down to whatever level I want or what other breakpoint I want to hit.

The only catch is if your functions are mutating input data (or some shared state somewhere), then you could be looking at different executions from one stack to the next.

One more reason to prefer pure functions over side-effects.

Thank you!