Literal punishment: for example, in the Code of Hammurabi, where someone's ox kills a child, then the ox owner's child is killed.
例如,在汉穆拉比法典里,如果某人的牛,杀死了一个小孩,那么这头牛的主人的小孩也应处死。
We want to write a piece of code that helps these guys out, so I'm going to show you an example.
通过写一段代码,来解决一个这样的问题,接下来让我们来看个例子。
In fact, this example would compile because you can use curly braces in this way to encapsulate lines of code, but realize for now, that, not good.
实际上,这个例子可以编译,因为你可以用这种方式来压缩代码行,但是请认识到,那个,不太好。
So let's look at the second example, all right, I keep doing that -- this piece of code from here to here gives me a way of now creating a hash table of size 256.
所以让我们来看一下第二个例子,好的,我继续做那件事,这段代码中从这里到这里,是创建一个大小为256的哈希表。
But here, if I decide I'm going to store things not in x and y, but with some other set of names, for example, I've gotta go back into these pieces of code that use the points, and change them. So I've lost modularity.
除了要改下借口,但是这里,如果我决定,我不把值放在x和y中,而是和其他一些变量名进行绑定,例如这样的话,我就得回到使用这个点的代码,那儿去做更改了。
应用推荐