WordSteps
‹
Есть вопросы?
закрыть

第4课 | MIT 6.00 计算机科学与编程导论,2008年秋

00:00:00
ANNOUNCER: Open content is provided under creative
00:00:02
commons license.
00:00:03
Your support will help MIT OpenCourseWare continue to
00:00:06
offer high-quality educational resources for free.
00:00:10
To make a donation, or view additional materials from
00:00:13
hundreds of MIT courses, visit MIT OpenCourseWare
00:00:17
at ocw.mit.edu .
00:00:19
PROFESSOR ERIC GRIMSON: As I've done in the previous lectures,
00:00:23
let me set the stage for what we've been doing, so we can
00:00:26
use that to talk about what we're going to do today.
00:00:30
So far, we have the following in our language.
00:00:35
Right, we have assignment.
00:00:41
We have conditionals.
00:00:46
We have input/output.
00:00:47
And we have looping constructs.
00:00:55
These are things like FOR and WHILE loops.
00:01:00
And of course we've got some data to go with that.
00:01:04
One of the things we said last time was, with that set of
00:01:07
things, the ability to give values-- sorry, to give names
00:01:11
to values-- the ability to make decisions, the ability to loop
00:01:14
as a function of that, the ability get things in and out,
00:01:17
we said that that actually gave us a language we said
00:01:21
was Turing-complete.
00:01:26
And that meant, in English, that this was enough
00:01:29
to write any program.
00:01:32
Now that's a slight lie-- or actually in these days of
00:01:34
political debates, a slight misspeaking, a wonderful word--
00:01:39
it is technically correct.
00:01:40
It is enough to allow us to write any program, but it's
00:01:43
not enough to allow us to easily write any program.
00:01:47
And so I joked, badly, I'll agree, at the end of last
00:01:50
lecture, that we can just stop now, go straight to the final
00:01:52
exam, because this is all you need to know.
00:01:54
The point is, yes it's enough to start with, but we want to
00:01:58
add things to this that let us problem solve well.
00:02:00
And one of the things to think about is, even though I've got
00:02:03
all of that, let's think about what I could do, if I wanted
00:02:06
to write a piece of code.
00:02:09
Right now, you've got to write it in one file.
00:02:11
It's a long sequence of instructions, it starts at the
00:02:14
beginning, walks through, may jump around a little bit, but
00:02:17
eventually comes down at the end.
00:02:19
It's okay for the things you're doing for the
00:02:21
early problem sets.
00:02:23
Ten lines of code.
00:02:24
Twenty lines of code.
00:02:25
Imagine instead, you're writing code that's a hundred thousand
00:02:28
lines, a million lines, of code.
00:02:31
You don't want to write it in this form.
00:02:34
All right, and the reason you don't want to do
показать еще
свой перевод
Работаем...
нет перевода