Now I got one just simple thing, and I simply have isolated that module inside of that function.What about abstraction?
而现在我只要做一件简单的事,那就是我只需把这个模块,加到函数中去?
What are the basic modules, what information needs to be passed between those modules in order to make the code work.
基本的模块是哪些,为了让整个程序正常运行,这些模块之间需要传递的信息有哪些。
On the left hand side is my palette of puzzle pieces or building blocks and those are the things.
在左边是拼图的调色板,或者建筑模块之类的东西。
Some people have argued there's a module for sociology, for dealing with human groups, races and classes and so on.
有些人认为大脑中存在一个社会学模块,用以面对各种人类团体,种族以及阶级等
We want to create data types and functions, or we're going to call them methods, that are specifically aimed at manipulating those kinds of objects.
它们是特定的,用来操作那些对象的,我们的目标基本上来说,就是会去看看怎么去构建,能利用这种模块话。
Divide and conquer to make our programs modular so we can write them a little piece at a time and understand them a little piece at a time.
我们把程序分解为模块逐个击破,以便我们能一次写一小段,一次理解一点儿,现在我觉得。
And so with these basic building blocks, can you build up much more interesting things and they don't have to be static animations like this.
通过使用这些基础构建模块,你就可以迅速创造出更多有趣的东西,没必要像这个动画一样呆板。
We'll talk more about this later, but it often happens that when you change your program to solve one problem you break it, and things that used to work don't work.
我们以后会更多的去讨论者一点,但是经常发生的情况是当你因为,一个问题修改你的程序的时候,你修改了程序,但原来没问题的模块。
And what I want to be talking about is modules of one sort, and of course that's because what we're interested in is modularity.
我想要说的是一种类型的模块,当然这是因为我们关注的是程序的可组合性,我们如何处理复杂程序呢?
Another question is if you believe in modules-- if there are modules, what are they?
另一个问题是,如果你相信模块理论,如果模块是存在的,那么它们究竟是什么
Some have even argued that there is an intuitive biology, a common-sense biological understanding of the world that's separate from your understanding of people and physics.
有些人甚至认为,大脑中存在着一个直觉生物学模块,这是一种与所具有的人类及物理学知识,并不相同的常识性生物学知识
First of all, I've used the notion of modularity.
首先,我用到了模块的概念。
We're going to run that module. OK.
我们将会运行这个模块,好的。
But other people have argued that there is a special module in your brain for dealing with artifacts, that is, things like tables and chairs and cars and forks.
但也有其他人认为,在大脑中存在一个特殊的,专门应用各种人工制品的模块,这些人工制品包括了桌椅,汽车,以及刀叉等
So here we have a repeat block.
在这里我们有一个重复模块。
I've captured a module inside of a function.
将一个方法内放入了一个模块。
First of all, notice the modularity.
首先,注意模块化。
And, in fact, the most dominant proponent of the view is our very own Frank Keil, master of Morse College at Yale, who has strongly defended the notion of an intuitive biological module.
事实上,这个观点最主要的支持者,是我们学校的弗兰克·凯尔,耶鲁莫尔斯学院的院长,他为直觉生物学模块做出了有力的辩护
An object module and a social module.
也就是客体模块和社会模块
We modularize things.
把一些事情都模块化了。
or at least one mechanism, I shouldn't say -- the only one-- one mechanism for doing that is going to be to add functions is that it's going to provide both of these things, so the first thing it's going to do is, it's going to let us break up into modules.
我们处理这些的机制--至少一种机制,我不会说只有一种,一种机制是在我们的语言中增加函数,函数的关键是它要提供分解和抽象,所以第一件要做的事,就是将代码分解为模块。
An alternative, though, is that there's separate modules, and this is a view developed, again, by Noam Chomsky, and also by the philosopher of mind Jerry Fodor, who claimed that the whole idea of a child developing as a single story is mistaken.
而另一种观点则认为是存在独立模块的,这个观点还是诺姆·乔姆斯基提出的,心灵哲学家杰瑞·福多尔,也同样提出过类似观点,这个观点认为,将儿童发展单独看待的整个观念,都是错误的
Final question, just to raise: I've talked in terms of the modular view but there might also be profound general differences between children and adults, not just specific to how you think about objects or how you think about people or how you think about this or how you think about that, but rather more general.
再说最后一个问题,我刚才是从模块理论的角度来讲述的,但在儿童与成人之间,或许还存在着深刻的一般性差异,不仅仅是具体到如何看待客体,如何看待他人,或是如何看待这个,如何看待那个,相反会更加一般化
Now I have the ability to say, I've got a new class, I can create instances of a line segment, and it's elements are themselves instances of points. OK?
这就是我们要讲模块化的地方了,现在我可以说,我创建了一个新类,我可以创建线段的实例了,这些实例的元素?
It's a way of breaking the code up into modules. Modules that makes sense on their own. Modules that we can reuse in multiple places. Modules that, if you like, Isolate components of the process.
能将代码分解为模块,模块能够独自运作,我们能在很多地方再利用这些模块,如果你喜欢的话,模块可以被看作是过程独立的组成部分。
I'd really like to have that modularity that says, I'm only going to get access to the values, not by calling their names, but by calling some specific method to get access to their names.
这样我们就丢掉了代码的模块化,我很希望代码有这样的模块化:,我访问变量的值,不是通过直接调用它们的名字,而是通过调用某个可以,访问这些变量名的方法来访问。
OK. Having done this now, I can simply go ahead and run this, and in fact if I go up here to run, you'll see I've got both an option to check the module, though in this case I'm just going to run it.
好,讲完了这些,我可以去执行程序了,实际上如果我在这里运行,你们会看到我同样得到了,一个可以同时检查模块的选项,虽然在这个例子中我就是直接去运行程序了。
I've listed a sequence of modules, the things that I want to do.
我先把我要做的事情,作为一系列的模块列了出来。
And that's a wonderful thing to have because it gives you that modularity, that encapsulation that basically says, when I create a point, the only way I can get at the values, is by using one of the defined methods, in this case it could be Cartesian, Cartesian and get all the pieces of that.
这是很棒的一件事情,因为它让你有了,模块性以及封装性,这基本上也就是说,当我创建了一个点,我能够得到它的值的唯一的方式,就是用一个定义好的方法,在这个例子中也就是。
I now have a module.
我在这里有一个模块。
应用推荐