有意调试而不使用调试器? [英] Purposefully debugging without using a debugger?

查看:121
本文介绍了有意调试而不使用调试器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第5章编程实践 Brian Kernighan Rob 派克写道:


作为个人选择,我们倾向于不要使用调试器来获取堆栈跟踪或一两个变量的值。

As a personal choice, we tend not to use debuggers beyond getting a stack trace or the value of a variable or two.



Although I have no empirical data on the topic, I suspect that it's likely that many programmers "live" in a debugger when they have one available in their environment. But I also suspect that there are many highly productive programmers who, like Kernighan and Pike, avoid debuggers as a first-line-of-defense and rely on other techniques.

所以,我想问stackoverflow社区:

So, I'd like to ask the stackoverflow community:

如果你是一种程序员,看到被称为调试器的工具是最后一个

一(1)为了更容易的投票,每个答案的原因!

One (1) reason per answer for easier voting please!

我也建议这个规则来回答:我不知道如何使用调试器是不是有效的答案。这只是无知。你应该在选择之前了解你的选择!

I'll also suggest this rule for answering: "I don't know how to use the debugger" is not a valid answer. That's just ignorance. You should understand your alternatives before making a choice!

推荐答案

通过你的代码不使用调试器F10 / F11可以让你更好的开发人员。

Not using the debugger to F10/F11 through your code can make you a better developer.

在我的第一份工作中,我在Linux中完成了大量的编程,Visual Studio调试器不可用。
由于调试困难,我已经学会了如何分析我的代码,并真正了解它的工作原理。而且,由于这个原因,我成了一个更好的开发人员。

During my 1st job I had done a lot of programming in Linux where Visual Studio debugger was not available. Because debugging was hard I've learnt how to analyse my code and really understand how it works. And I became a better developer because of that.

现在我只有在通过代码搜索通常的嫌疑人之后才使用调试器,如果我不明白我的代码如何工作,没有调试,然后我重构它。

Nowadays I do use the debugger only after I've gone over the code and searched for the "usual suspects" and if I do not understand how my code works without debugging it then I refactor it.

这篇关于有意调试而不使用调试器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆