|
|
|
|
|
by cxr
1200 days ago
|
|
Rob Pike goes quite a bit further than that—don't even use printf or look at stack traces: > A year or two after I'd joined the Labs, I was pair programming with Ken Thompson [...] Ken taught me that thinking before debugging is extremely important. If you dive into the bug, you tend to fix the local issue in the code, but if you think about the bug first, how the bug came to be, you often find and correct a higher-level problem in the code that will improve the design and prevent further bugs.¶ I recognize this is largely a matter of style. Some people insist on line-by-line tool-driven debugging for everything. But I now believe that thinking—without looking at the code—is the best debugging tool of all, because it leads to better software. <https://www.informit.com/articles/article.aspx?p=1941206> |
|