So you say well, rather than rushing off and fixing this one bug, let me pull back and ask, bug is this a systematic mistake that I've made throughout the program?
因此我们应该回头想想,这是不是我在整个程序中都,在犯的一个系统性错误,而不是匆匆忙忙的去修复这一个,如果确实是系统性错误的话?
So something has happened there that wasn't what I expected. Who wants to tell me what that bug is? Yeah?
我已经知道哪一句声明出问题了,一些和我预期不同的事情发生了,有人能告诉我bug在哪儿么?
I've had graduate students come to me and say I found a bug in my program.
你该感到自豪么?经常有毕业生,来找到我并告诉我。
Sometimes when I'm really stuck, I say, alright let me stop looking for the bug.
有些时候我被卡住了,我会说好吧。
You find some way of systematically going through the list. Yet, I often see people, when they're debugging, proceeding at what, to me, looks almost like a random fashion of looking for the bug.
是不是目标元素,我们有一种系统化的,遍历数组的方法,然后我经常看到,有些人调试的时候。
it turns out, that this will be a bug, and I want you to think about why it's wrong for me to put this check here.
结果表明我们这儿有一个漏洞,我希望你们去想一想为什么,我把这个check放在这儿就出现漏洞了。
The beauty of this is, it keeps me from getting lazy, and not only testing my program and the thing that found the bug, but in all the things that used to work.
运行函数而不用再输入了,这其中的,美妙之处在于,它让我变的勤快了点,并不是仅仅的去测试程序发现bug方面,同样适用于那些正常工作的模块。
应用推荐