Purposefully debugging without using a debugger?

后端 未结 20 1797
春和景丽
春和景丽 2021-02-01 08:49

In chapter 5 of \"The Practice of Programming\" Brian Kernighan and Rob Pike write:

As a personal choice, we tend not to use debuggers beyond getting a st

20条回答
  •  醉梦人生
    2021-02-01 09:36

    Two reasons for not using a debugger include:

    • There isn't a debugger installed on the customer machine where the fault is happening
    • You can't afford to stop the (live) process (on the customer machine) to inspect it using a debugger

    I don't know if I'm "that kind of programmer" but I don't see what you'd want of a debugger beyond:

    • Break at breakpoint and/or break when an exception is thrown
    • Inspect data and inspect the callstack during a break

    I've heard some people suggest that you step through code with a debugger when you write it, as a kind of code inspection, but I don't do that.

提交回复
热议问题