Let's go back to high school for a moment, just by way of background.
让我们回到高中,去寻找一些相关背景。
Because a lot of these ships go blub on the way back, or are taken by pirates and stuff like that, they say, "We want to insure this ship.
因为有很多船只在回程的时候会损坏,或是被海盗之类的匪徒抢劫,他们说,"我们想为这船提供保险
So how would we go about solving this problem if I told you not only was there a maximum weight, but there was a maximum volume. Well, we want to go back and attack it exactly the way we attacked it the first time, which was write some mathematical formulas.
有些时候两个都重要,所以如果我告诉你这里不仅有,最大重量还有最大容量,我们应该怎么解决这个问题呢?,好了,我们想回过来然后,和第一次一样看看这个问题。
What we're really getting at is the idea of saying I want to have a way of grouping together information into units that make sense. So I can go back to one of those topics we had at the beginning, which is the idea of abstraction, that I can create one of those units as a simple entity, bury away the details and write really modular code.
组合成为有意义的单元,那么这就让我们回到,一开始讲的话题之一了,这就是抽象的概念,也就是我可以以一个简单的,实体的形式创建这样的一个单元,把具体实现隐藏然后写一些,真正模块化的代码,我们在以后的课程中。
应用推荐