By putting it in a function bug if I find a bug and I change my program I can just run the function again.
把我输入的值放到一个函数里,如果以后我在程序中发现了一个,并对程序进行更改的话,我可以直接。
bug It's not true now. If there is a bug in the program it's there for only one reason.
如果程序中有一个,那一定是有原因的,是你通过例如犯了。
We're actually making a legitimate copy with this version of the program so I don't have this bug in anymore.
我们使用这个程序版本,做了一个合法的拷贝,这样我就没有这个bug了。
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?
因此我们应该回头想想,这是不是我在整个程序中都,在犯的一个系统性错误,而不是匆匆忙忙的去修复这一个,如果确实是系统性错误的话?
I've had graduate students come to me and say I found a bug in my program.
你该感到自豪么?经常有毕业生,来找到我并告诉我。
bug Now, this was not the bug in this program because I did, in fact, use the equality operator and so it feels like if I type the word foo both times I should, in fact, get back you type the same thing.
现在,在这个程序中这个不是,因为,实际上,我使用了等于号,如果我输入单词foo两次,我返回给你“输入了相同的东西“
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方面,同样适用于那些正常工作的模块。
The goal is to move towards a bug free program.
而是去得到一个没有bug的程序。
应用推荐