An idea of abstraction, that idea of specification, is exactly what we want to use inside of our functions.
抽象的概念,规格化的概念,就是我们想要运用到。
All right, so that notion of abstraction and we're going to come back to multiple times -- during the term-- and it's not just abstraction, -- it's the idea of a specification.
现在就试试,这就是抽象的概念,我回过来说,我们将要多次提到这个术语。
You have to pass it as input to another function, as you'll see as possible in problem's Set One specification, but it's ultimately up to you.
你需要把它传给另一个函数当入参,就像你们将,在习题集1中可能看到的,但它最终取决于你。
There's one more piece that we'd like to get out of that, and that is-- you may have been wondering, what's with the funky stuttering here of three double-quotes in a row. All right? And that is a specification.
但是你没有屏蔽这个函数的使用细节,在这里我们还想再讲一讲,那就是--你可能正在想,这里连续3个奇怪双引号,是干什么用的。
What do I need for those writers to all interact together? I need a specification.
这个比方的意义什么呢?,我需要怎么做才能使。
So one of the things I want you to notice here is that testing and debugging are not the same thing. When we test, we compare an input output pair to a specification.
这里我想大家注意的一件事,就是测试和调试是不同的两件事情,我们测试的时候,我们把输入输出,跟程序的规格说明书对比下。
So what is the specification going to do?
这也是很有价值的内容?
In some sense, strictly speaking they shouldn't be necessary because the fact that my specification starts with an assumption, says, hey you, who might call square root make sure that the things you call me with obey the assumption.
在某种意义上严格的来讲,它们不是必要的,因为我已经对假设做了声明,也就是说,如果你要调用我的,求平方根的函数,请确保你传递给我的,参数满足假设条件。
Before we do that, or as you do that, let's look at Fib 1. The key thing to notice about Fib 1 is that it has the same specification as Fib.
我们做之前,或者当你在思考的过程中,让我们看看Fib,1,Fib1重要注意的,关键的一点就是,他和Fib的格式描述是一样的。
And notice, by the way, if I do that, and I type sqrt and open the paren, ah-ha! It shows me what the creator, in this case actually I stole this from John so what Professor Guttag put up as his specification for this piece of code.
它需要什么养的输入和其它我想传达的信息,如果我这么做了,我将会到这里打上sqrt并且加上括号,啊哈!这里告诉我这段程序的创建者,事实上这是我是从约翰那里偷来的,所以也就是Guttag教授在它的。
应用推荐