forked from Andrew-liu/Learning-SICP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlec1a.srt
5208 lines (4167 loc) · 130 KB
/
lec1a.srt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1
00:00:01,100 --> 00:00:04,500
哈尔滨工业大学 IBM技术中心
倾情制作
2
00:00:04,600 --> 00:00:09,400
压制&&特效:蔡钟敏(Tacitus)
字幕&&时间轴:邓雄飞(Dysprosium)
3
00:00:09,500 --> 00:00:13,000
特别感谢:裘宗燕
4
00:00:14,264 --> 00:00:17,440
欢迎大家来一起学习这门计算机科学的基础课程
I'd like to welcome you to this course on computer science.
5
00:00:27,952 --> 00:00:29,408
事实上 以这样的方式来表述并不恰当
Actually, that's a terrible way to start.
6
00:00:29,408 --> 00:00:31,890
于此来说 计算机科学是个糟糕的名字
Computer science is a terrible name for this business.
7
00:00:32,384 --> 00:00:33,856
首先 它不算是一门科学
First of all, it's not a science.
8
00:00:35,472 --> 00:00:39,020
它更应该被称为工程或者是艺术
It might be engineering or it might be art,
9
00:00:39,648 --> 00:00:42,464
但我们实际上会发现 这个所谓的计算机科学
but we'll actually see that computer so-called science
10
00:00:42,480 --> 00:00:44,528
却与魔法一样的有众多神奇之处
actually has a lot in common with magic,
11
00:00:44,560 --> 00:00:45,904
这些将会在课程中一一体现
and we'll see that in this course.
12
00:00:46,832 --> 00:00:47,776
所以 不能称其为一门科学
So it's not a science.
13
00:00:48,648 --> 00:00:51,854
这门学科和“计算机”也并非紧密相关
It's also not really very much about computers.
14
00:00:52,944 --> 00:00:55,024
类似的 就像我们说
And it's not about computers in the same sense
15
00:00:55,024 --> 00:00:59,600
物理学中并不仅仅有关粒子加速器
that physics is not really about particle accelerators,
16
00:01:00,352 --> 00:01:05,136
生物学中并不全然是显微镜和培养皿一样
and biology is not really about microscopes and petri dishes.
17
00:01:06,010 --> 00:01:09,800
同理
And it's not about computers in the same sense
18
00:01:09,860 --> 00:01:14,432
几何学中也并不全是介绍如何使用测量仪器
that geometry is not really about using surveying instruments.
19
00:01:16,032 --> 00:01:18,560
事实上 计算机科学和几何学
In fact, there's a lot of commonality
20
00:01:18,880 --> 00:01:21,000
有很多共性
between computer science and geometry.
21
00:01:21,000 --> 00:01:22,213
首先 几何学
Geometry, first of all,
22
00:01:22,579 --> 00:01:24,535
只是另一个有个糟糕名字的学科
is another subject with a lousy name.
23
00:01:25,136 --> 00:01:27,400
这个名字来自于Gaia 意为土地
The name comes from Gaia, meaning the Earth,
24
00:01:27,450 --> 00:01:28,640
以及metron 意为测量
and metron, meaning to measure.
25
00:01:29,376 --> 00:01:32,944
几何学最初意为测地或者勘探
Geometry originally meant measuring the Earth or surveying.
26
00:01:33,920 --> 00:01:36,440
这是因为数千年前的埃及祭司
And the reason for that was that, thousands of years ago,
27
00:01:37,248 --> 00:01:41,248
为了计算如何去修复年年被尼罗河的洪水
the Egyptian priesthood developed the rudiments of geometry
28
00:01:42,144 --> 00:01:45,888
所毁坏的牧田边界
in order to figure out how to restore the boundaries of fields
29
00:01:45,888 --> 00:01:45,904
而建立了几何学基础
that were destroyed in the annual flooding of the Nile.
30
00:01:45,904 --> 00:01:48,240
而建立了几何学基础
that were destroyed in the annual flooding of the Nile.
31
00:01:49,024 --> 00:01:50,208
而对出于这个目的的埃及人来说
And to the Egyptians who did that,
32
00:01:50,208 --> 00:01:53,488
几何学的确是掌握对测量仪器的使用
geometry really was the use of surveying instruments.
33
00:01:55,184 --> 00:01:58,100
现在 我们以为计算机科学就是介绍计算机的使用
Now, the reason that we think computer science is about computers
34
00:01:58,120 --> 00:02:02,048
就正如埃及人认为
is pretty much the same reason that the Egyptians thought geometry
35
00:02:02,064 --> 00:02:03,650
几何学是介绍如何使用测量仪器的
was about surveying instruments.
36
00:02:04,140 --> 00:02:06,928
换句话说 任何一门学科起步的时候
And that is, when some field is just getting started
37
00:02:06,940 --> 00:02:09,410
你都对它了解不深
and you don't really understand it very well,
38
00:02:10,656 --> 00:02:16,192
这很容易使你混淆所做的事与所用之物
it's very easy to confuse the essence of what you're doing with the tools that you use.
39
00:02:17,200 --> 00:02:19,856
确实 就绝对规模来说
And indeed, on some absolute scale of things,
40
00:02:19,856 --> 00:02:24,370
我们对计算机科学的实质的了解
we probably know less about the essence of computer science
41
00:02:24,384 --> 00:02:27,040
比埃及人对几何学的了解还少
than the ancient Egyptians really knew about geometry.
42
00:02:29,808 --> 00:02:32,192
那么 我所谓的计算机科学的本质是什么呢
Well, what do I mean by the essence of computer science?
43
00:02:32,208 --> 00:02:33,960
我所谓的几何学本质又是什么呢
What do I mean by the essence of geometry?
44
00:02:33,968 --> 00:02:36,000
看 可以确认的是 古埃及人确实使用测量仪器
See, it's certainly true that these Egyptians went off
45
00:02:36,016 --> 00:02:37,220
并且已经消失多年
and used surveying instruments,
46
00:02:37,248 --> 00:02:41,104
但当我们在几千年后回过头来重新审视这段历史
but when we look back on them after a couple of thousand years,
47
00:02:41,120 --> 00:02:41,408
我们会说
we say,
48
00:02:41,424 --> 00:02:43,190
天啊 看他们在做什么
gee, what they were doing,
49
00:02:43,264 --> 00:02:45,030
他们的工作是多么的重要
the important stuff they were doing,
50
00:02:45,170 --> 00:02:50,000
已经开始对时间和空间进行形式化表述
was to begin to formalize notions about space and time,
51
00:02:51,136 --> 00:02:57,080
并归纳出一套讨论数学真理的形式化方法
to start a way of talking about mathematical truths formally.
52
00:02:57,568 --> 00:02:59,168
这直接导致了公理化方法
That led to the axiomatic method.
53
00:02:59,168 --> 00:03:02,080
以及各种现代数学的产生
That led to sort of all of modern mathematics,
54
00:03:03,712 --> 00:03:06,450
同时也指明了一种精确讨论
figuring out a way to talk precisely about
55
00:03:06,800 --> 00:03:09,740
所谓的描述真理的陈述性知识的方法
so-called declarative knowledge, what is true.
56
00:03:12,000 --> 00:03:15,808
与此相似的 我认为未来人们会回过头来审视并说
Well, similarly, I think in the future people will look back and say,
57
00:03:15,824 --> 00:03:18,912
啊 这些20世纪的原始人
yes, those primitives in the 20th century were fiddling around
58
00:03:18,912 --> 00:03:20,750
不务正业地玩弄着叫计算机的小玩意
with these gadgets called computers,
59
00:03:21,328 --> 00:03:25,800
但它们真正在做的是开始学习
but really what they were doing is starting to learn
60
00:03:25,808 --> 00:03:32,100
如何去对计算过程进行形式化表述
how to formalize intuitions about process,
61
00:03:32,192 --> 00:03:33,680
如何去解决问题
how to do things,
62
00:03:38,576 --> 00:03:50,800
并结合两者发展一套对问题处理过程精确表述的方法
starting to develop a way to talk precisely about how-to knowledge,
63
00:03:51,312 --> 00:03:55,580
这与讨论真理的几何学形成了对照
as opposed to geometry that talks about what is true.
64
00:03:56,080 --> 00:03:58,120
让我给你们举个例子吧
Let me give you an example of that.
65
00:04:01,856 --> 00:04:02,240
来瞧瞧
Let's take a look
66
00:04:02,256 --> 00:04:09,376
数学中是这样来定义平方根的:
Here is a piece of mathematics that says what a square root is.
67
00:04:09,648 --> 00:04:13,900
定义X的平方根Y是这样一个数
The square root of X is the number Y,
68
00:04:15,536 --> 00:04:19,936
Y的平方等于X 且Y大于等于0
such that Y squared is equal to X and Y is greater than 0.
69
00:04:19,984 --> 00:04:22,050
这是一个很好的定义
Now, that's a fine piece of mathematics,
70
00:04:22,432 --> 00:04:24,800
但它只告诉了你平方根是什么
but just telling you what a square root is
71
00:04:25,184 --> 00:04:29,840
却没有告诉你如何去求取一个平方根
doesn't really say anything about how you might go out and find one.
72
00:04:30,976 --> 00:04:35,456
那么我们将其与一条指令性知识做比较
So let's contrast that with a piece of imperative knowledge,
73
00:04:36,688 --> 00:04:39,472
你如何去求取一个平方根
how you might go out and find a square root.
74
00:04:39,504 --> 00:04:45,296
事实上 这来自于埃及 不太久远的埃及
This, in fact, also comes from Egypt, not ancient, ancient Egypt.
75
00:04:45,310 --> 00:04:48,430
亚历山大的Heron提出的一个算法
This is an algorithm due to Heron of Alexandria,
76
00:04:49,456 --> 00:04:52,320
称作连续取均值求平方根法
called how to find a square root by successive averaging.
77
00:04:52,448 --> 00:04:54,688
这个算法是说
And what it says is that,
78
00:04:54,704 --> 00:04:57,616
为了算出平方根
in order to find a square root,
79
00:05:02,896 --> 00:05:07,880
首先你应该给出一个猜测值guess 并不断改进
you make a guess, you improve that guess --
80
00:05:09,744 --> 00:05:10,992
改进的方法是通过
and the way you improve the guess
81
00:05:11,008 --> 00:05:13,500
不断求猜测值guess与X/guess的平均值
is to average the guess and X over the guess,
82
00:05:13,968 --> 00:05:15,152
我们稍后将会讨论
and we'll talk a little bit later about
83
00:05:15,168 --> 00:05:16,670
为什么这是合理的
why that's a reasonable thing--
84
00:05:16,690 --> 00:05:18,920
通过不断改进 直到它足够精确
and you keep improving the guess until it's good enough.
85
00:05:19,280 --> 00:05:20,400
这就是实现方法
That's a method.
86
00:05:20,540 --> 00:05:24,208
这也是如何完成一项工作与
That's how to do something as opposed to
87
00:05:24,272 --> 00:05:26,880
其对应的陈述性知识的对照
declarative knowledge that says what you're looking for.
88
00:05:27,600 --> 00:05:29,310
这就是一个过程
That's a process.
89
00:05:33,952 --> 00:05:37,808
那么 通常来说什么是过程呢?
Well, what's a process in general?
90
00:05:38,560 --> 00:05:39,690
这定义起来非常困难
It's kind of hard to say.
91
00:05:39,712 --> 00:05:43,270
你可以将它象征性地看成一个活在计算机内
You can think of it as like a magical spirit
92
00:05:44,320 --> 00:05:46,880
并且可以完成一些操作的精灵
that sort of lives in the computer and does something.
93
00:05:47,568 --> 00:05:53,664
一些被称为程序的规则模式
And the thing that directs a process is
94
00:05:53,680 --> 00:05:57,530
指导着这类过程的进行
a pattern of rules called a procedure.
95
00:06:01,536 --> 00:06:04,280
程序可以被认为是符咒
So procedures are the spells, if you like,
96
00:06:04,784 --> 00:06:08,950
使用程序来控制这些精灵完成一些操作就叫做过程
that control these magical spirits that are the processes.
97
00:06:10,304 --> 00:06:12,304
你们知道人人都需要一门魔法语言
I guess you know everyone needs a magical language,
98
00:06:12,320 --> 00:06:14,100
那些魔术师 真正的魔术师 用远古的阿卡狄亚语
and sorcerers, real sorcerers,
99
00:06:14,128 --> 00:06:18,140
或者苏美尔语 或者巴比伦语 或者其它的
use ancient Arcadian or Sumerian or Babylonian or whatever.
100
00:06:18,176 --> 00:06:19,640
而我们将用一门叫Lisp的魔法语言
We're going to conjure our spirits
101
00:06:19,680 --> 00:06:22,260
来召唤出我们的精灵
in a magical language called Lisp,
102
00:06:23,920 --> 00:06:27,568
这门语言是被设计用来
which is a language designed for talking about,
103
00:06:28,128 --> 00:06:31,390
编写如咒语版的程序 来指导过程的进行
for casting the spells that are procedures to direct the processes.
104
00:06:31,424 --> 00:06:33,460
学习Lisp非常容易
Now, it's very easy to learn Lisp.
105
00:06:33,520 --> 00:06:35,536
事实上 我会在几分钟内教会你
In fact, in a few minutes, I'm going to teach you,
106
00:06:35,552 --> 00:06:36,710
整个Lisp
essentially, all of Lisp.
107
00:06:36,926 --> 00:06:38,515
及其所有的规则
I'm going to teach you, essentially, all of the rules.
108
00:06:40,320 --> 00:06:43,200
你不必感到很惊讶
And you shouldn't find that particularly surprising.
109
00:06:43,240 --> 00:06:45,424
这就像你在学习象棋时
That's sort of like saying it's very easy
110
00:06:45,456 --> 00:06:46,560
认为象棋的规则十分简单一样
to learn the rules of chess.
111
00:06:46,592 --> 00:06:47,680
事实也如此 几分钟内
And indeed, in a few minutes,
112
00:06:47,728 --> 00:06:49,250
你可以与任何人谈论象棋的规则
you can tell somebody the rules of chess.
113
00:06:50,368 --> 00:06:51,792
但是 这全然不等同于说
But of course, that's very different from
114
00:06:51,808 --> 00:06:54,928
你所知道这些规则所蕴含的东西
saying you understand the implications of those rules
115
00:06:54,970 --> 00:06:57,600
以及如何利用这些规则去成为象棋大师
and how to use those rules to become a masterful chess player.
116
00:06:58,048 --> 00:06:59,370
Lisp也是如此
Well, Lisp is the same way.
117
00:06:59,968 --> 00:07:01,730
我将在几分钟内道清规则
We're going to state the rules in a few minutes,
118
00:07:01,910 --> 00:07:03,104
这说起来非常容易
and it'll be very easy to see.
119
00:07:03,170 --> 00:07:06,640
但真正困难的是如何运用这些规则
But what's really hard is going to be the implications of those rules,
120
00:07:06,870 --> 00:07:10,010
以及你如何利用这些规则成为编程大师
how you exploit those rules to be a master programmer.
121
00:07:11,610 --> 00:07:14,848
这些规则的应用将占据我们
And the implications of those rules are going to take us the,
122
00:07:14,860 --> 00:07:18,110
余下的课程 甚至更多
well, the whole rest of the subject and, of course, way beyond.
123
00:07:21,008 --> 00:07:22,660
所以 在计算机科学中
OK, so in computer science,
124
00:07:24,048 --> 00:07:25,744
我们的任务则是
we're in the business of
125
00:07:25,760 --> 00:07:30,130
形式化这种如有关“怎么做”的指令性知识
formalizing this sort of how-to imperative knowledge,
126
00:07:30,176 --> 00:07:31,650
并将之付诸实际
how to do stuff.
127
00:07:32,928 --> 00:07:34,944
这也便是计算机科学的真正的议题
And the real issues of computer science are, of course,
128
00:07:34,960 --> 00:07:37,910
当然 并不是告诉人们如何去求平方根
not telling people how to do square roots.
129
00:07:38,640 --> 00:07:39,616
因为如果那是计算机科学的全部的的话
Because if that was all it was,
130
00:07:39,648 --> 00:07:40,896
就不会有什么大问题了
there wouldn't be no big deal.
131
00:07:41,120 --> 00:07:43,600
真正的问题来自于当我们尝试
The real problems come when we try to
132
00:07:43,632 --> 00:07:45,710
构建非常非常大的系统时
build very, very large systems,
133
00:07:46,160 --> 00:07:49,080
程序可能会长达数千页
computer programs that are thousands of pages long,
134
00:07:49,136 --> 00:07:53,536
长得没有人能马上将其装入脑中
so long that nobody can really hold them in their heads all at once.
135
00:07:54,288 --> 00:07:58,360
而使这些得以实现则是因为
And the only reason that that's possible is because
136
00:07:58,410 --> 00:08:18,528
我们有在大系统中控制复杂度的技术
there are techniques for controlling the complexity of these large systems.
137
00:08:19,850 --> 00:08:22,240
这些控制复杂度的技术
And these techniques that are controlling complexity
138
00:08:22,272 --> 00:08:23,728
正是我们课程所讨论的
are what this course is really about.
139
00:08:24,208 --> 00:08:25,024
从某种意义上来说
And in some sense,
140
00:08:25,056 --> 00:08:27,020
这也正是计算机科学的关键所在
that's really what computer science is about.
141
00:08:29,180 --> 00:08:31,440
这样说听起来或许很奇怪
Now, that may seem like a very strange thing to say.
142
00:08:31,472 --> 00:08:35,168
毕竟 除了计算机科学家外
Because after all, a lot of people besides computer scientists
143
00:08:35,200 --> 00:08:37,370
仍然有很多人在做复杂度控制相关的工作
deal with controlling complexity.
144
00:08:37,390 --> 00:08:40,570
一个航班就是一个非常复杂的系统
A large airliner is an extremely complex system,
145
00:08:41,376 --> 00:08:43,344
设计它的航空工程师
and the aeronautical engineers who design that
146
00:08:43,600 --> 00:08:45,680
便在处理这个巨大的复杂度
are dealing with immense complexity.
147
00:08:46,640 --> 00:08:49,740
但这种复杂度又与
But there's a difference between that kind of complexity
148
00:08:50,304 --> 00:08:52,150
计算机科学中的(复杂度)有别
and what we deal with in computer science.
149
00:08:54,736 --> 00:08:57,280
从某种意义上来说
And that is that computer science,
150
00:08:57,344 --> 00:08:59,648
因为计算机科学不是“现实”的
in some sense, isn't real.
151
00:09:02,240 --> 00:09:06,170
例如 当一名工程师设计物理系统时
You see, when an engineer is designing a physical system,
152
00:09:06,690 --> 00:09:08,040
这些都是由实在的物理部件构成
that's made out of real parts.
153
00:09:08,950 --> 00:09:10,736
负责的该工作的工程师
The engineers who worry about that
154
00:09:11,400 --> 00:09:16,208
就得对付系统中的公差、近似值以及噪声
have to address problems of tolerance and approximation and noise in the system.
155
00:09:16,224 --> 00:09:18,576
譬如说 作为一名电气工程师
So for example, as an electrical engineer,
156
00:09:18,640 --> 00:09:21,264
可以很容易的做一个单极放大器
I can go off and easily build a one-stage amplifier
157
00:09:21,280 --> 00:09:22,580
或者是一个双极放大器
or a two-stage amplifier,
158
00:09:22,960 --> 00:09:24,944
也可想象将其大量串联
and I can imagine cascading a lot of them
159
00:09:25,008 --> 00:09:26,464
来建造一个百万极的放大器
to build a million-stage amplifier.
160
00:09:26,540 --> 00:09:28,304
但这样做是不可行的
But it's ridiculous to build such a thing,
161
00:09:28,530 --> 00:09:31,700
因为在远没到百万数量级的时候
because long before the millionth stage,
162
00:09:31,710 --> 00:09:34,112
这种组合方法打从头产生的热噪声
the thermal noise in those components way at the beginning
163
00:09:34,120 --> 00:09:36,352
会慢慢增强 并使得我们的幸苦付之一炬
is going to get amplified and make the whole thing meaningless.
164
00:09:38,650 --> 00:09:42,670
计算机科学处理的是理想化组件
Computer science deals with idealized components.
165
00:09:43,670 --> 00:09:47,184
我们对将要结合在一起的
We know as much as we want about these little program
166
00:09:47,200 --> 00:09:49,110
程序和数据了如指掌
and data pieces that we're fitting things together.
167
00:09:51,456 --> 00:09:52,752
我们不需要去关心公差
We don't have to worry about tolerance.
168
00:09:52,760 --> 00:09:56,540
也就是说 在构建大系统时
And that means that, in building a large program,
169
00:09:57,680 --> 00:09:59,580
在我理想和现实之间
there's not all that much difference
170
00:09:59,900 --> 00:10:03,730
并不没有太大的不同
between what I can build and what I can imagine,
171
00:10:05,088 --> 00:10:07,152
因为这些部分都是抽象单元
because the parts are these abstract entities
172
00:10:07,184 --> 00:10:09,872
可以随心所欲的组合
that I know as much as I want.
173
00:10:09,888 --> 00:10:11,940
可以据目前所知而自由构建
I know about them as precisely as I'd like.
174
00:10:13,008 --> 00:10:15,050
就是与其它的工程不同之处
So as opposed to other kinds of engineering,
175
00:10:15,210 --> 00:10:16,976
(在其它的工程中)对你所构建系统的约束
where the constraints on what you can build
176
00:10:16,990 --> 00:10:18,450
来自于物理系统以及
are the constraints of physical systems,
177
00:10:18,490 --> 00:10:20,576
物理定律 噪声 近似值等
the constraints of physics and noise and approximation,
178
00:10:20,760 --> 00:10:25,152
而建立大型软件系统时所施加的约束
the constraints imposed in building large software systems
179
00:10:25,190 --> 00:10:27,130
就是对我们大脑的限制
are the limitations of our own minds.
180
00:10:28,670 --> 00:10:29,536
从这个角度来看
So in that sense,
181
00:10:29,550 --> 00:10:33,220
计算机科学就像是工程中的一种抽象形式
computer science is like an abstract form of engineering.
182
00:10:33,350 --> 00:10:35,280
在这种工程中 我们忽略
It's the kind of engineering where you ignore
183
00:10:35,310 --> 00:10:37,570
现实所施加的约束
the constraints that are imposed by reality.
184
00:10:41,520 --> 00:10:45,700
那么 这其中有哪些技术呢
Well, what are some of these techniques?
185
00:10:45,830 --> 00:10:47,940
计算机科学中并没有特别的技术
They're not special to computer science.
186
00:10:49,940 --> 00:10:52,100
第一个技术是在很多工程中都使用的
First technique, which is used in all of engineering,
187
00:10:52,910 --> 00:10:58,464
被称为“黑盒抽象”的方法
is a kind of abstraction called black-box abstraction.
188
00:11:07,264 --> 00:11:12,130
即将一些东西组合并封装起来
Take something and build a box about it.
189
00:11:13,920 --> 00:11:19,648
以之前我们提到的求取平方根的方法为例
Let's see, for example, if we looked at that square root method,
190
00:11:22,190 --> 00:11:28,080
我将这些操作视为一个“盒子”
I might want to take that and build a box.
191
00:11:29,440 --> 00:11:37,072
也就是说 为了找到X的平方根
That sort of says, to find the square root of X.
192
00:11:38,416 --> 00:11:40,820
或许会有一系列的复杂规则
And that might be a whole complicated set of rules.
193
00:11:42,192 --> 00:11:46,240
我们将规则封装 输入数据即可获得结果
And that might end up being a kind of thing where I can put in,
194
00:11:46,368 --> 00:11:49,610
比如说 输入36 然后说36的平方根是多少呢
say, 36 and say, what's the square root of 36?
195
00:11:49,808 --> 00:11:51,010
则给出结果 6
And out comes 6.
196
00:11:53,440 --> 00:11:55,776
重点是
And the important thing is that
197
00:11:55,790 --> 00:11:59,584
通过这样的设计
I'd like to design that so that
198
00:11:59,612 --> 00:12:03,633
可以方便他人的使用
if George comes along and would like to compute,
199
00:12:04,656 --> 00:12:08,928
例如Goerge想计算A的平方根加上B的平方根
say, the square root of A plus the square root of B,
200
00:12:10,896 --> 00:12:13,936
他无需了解“盒子”内部的构成
he can take this thing and use it as a module
201