Who was also one of the word's first programmers. So she was trying to write this program, and it didn't work.
也是世界上最早的几个程序员之一,她正尝试着完成一个,复杂的求反正切的程序。
It gives you a lot of expressive convenience, you can write the programs much more cleanly, but most importantly, it's fast.
你可以把一些程序写的更清楚,最重要的是,它的效率非常高。
>> They only use that when the program that you're running-- the program that you're referring to is going to your computer?
>它只有在你运行程序的时候才用到-,那你刚刚提到的程序,会到你的电脑上运行吗?
But I was a really good programmer and I wanted to understand the consumer side of the Internet.
但我是个很好的程序设计师,我想了解互联网关于消费者的一面。
Why does agreement to a certain procedure, even a fair procedure, justify whatever result flows from the operation of that procedure?
为什么只要经过了特定程序,公平的程序,不管任何结果都可以视为正当呢?
So when we're designing stuff, we look not necessarily just about what any given users going to experience but what's going to be better for the whole community and the whole product.
设计应用程序时,我们并非只重视用户体验,而更注重该程序,对于整个社会以及产品是否有益。
So how do chess-playing programs, and particularly the best chess-playing programs, how do they work? Well, they play chess the same way you do.
那么,下棋程序,特别是最好的下棋程序,是如何工作的呢,它们的下棋方式同你们如出一辙
As you build these kinds of simulations, or anything like this, you need to think through whether things should be multiplicative or additive.
正如你建立各种仿真程序,或者类似的仿真程序时,你应该去想一想,他们应该是用加法还是用乘法。
Said a different way, in the case of the straight-line programs, how long would it take to run a program?
换种说法,在直线式程序里面,运行一个程序要多长时间?
So the moral here, again, is whenever you're doing an implementation of a simulation, you do need to have some underlying theory about the model.
所以这里的寓意还是,不管你在做什么东西的仿真程序,你需要有一个,模型的底层程序。
But it is a very handy way of thinking about, not just how to program, but how to break problems down into nice sized chunks.
但是它确实是一种很方便的思考方式,不仅仅限于编程序,在将程序分解为小部分时也很有用。
You should acquire overtime this instinctive aversion to just code or programs that just look ugly because things that look ugly generally are not easy to maintain.
对于代码和程序你会有一种本能的讨厌,这是因为这些代码和程序看起来很丑陋,并且不容易维护。
There are absolutely going to be times where you're running a program where the programmer, say you, didn't possibly know in advanced how much RAM the program was going to need.
它们总是在,程序员运行程序的地方,你可能预先不知道那个程序,需要多少内存。
And indeed, when they program these things, the programmers will feed in game after game after game of the great chess games in history.
的确,当人们编写游戏程序时,会在这些程序中,一局接一局地,输入历史上那些最伟大的棋局
Remember, it's not as though the people who designed the chess-playing programs can beat it.
记住,那些设计象棋程序的人,貌似也下不过他们的象棋程序
As every time we introduce a new programming concept, we'll relate it back, as we have been doing consistently, to defensive programming.
我们每次介绍一个,新的编程概念的时候,就会和以前讲的联系起来,就和我们介绍防卫性程序设计一样。
So in general, when you're running command line programs, they can take input or arguments or parameters or switches or flags.
一般而言,当你运行命令行程序时,可以把把这些当做输入,像什么参数啊,或开关啊,或标志啊等等。
By putting it in a function bug if I find a bug and I change my program I can just run the function again.
把我输入的值放到一个函数里,如果以后我在程序中发现了一个,并对程序进行更改的话,我可以直接。
You double click an icon, the program gets loaded into memory, well, conceptually where does your program end up?
双击一个图标,程序就被加载到内存中,那么,程序在哪里结束?
It's because the programmer or programmers that wrote that software might have been pretty specific but not specific enough.
这是因为程序员写的软件,可能已经相当具体,但还是不够具体。
You will be able to infer from some of our code how in fact you can implement some more sophisticated programs.
你可以从一些代码中推断出,应该要怎样实现一些较复杂的程序。
And this one will be particularly germane to a portion of Problem Set 1, at least in Problem Set 1.
这个程序跟习题集1中的,一部分比较相似,至少在习题1中。
So really, once we start writing more interesting programs, you would have to type out long annoying commands like that to just compile more sophisticated programs.
实际上,一旦我们开始写一些更复杂的程序时,你们可能要键入那样一些长的,讨厌的命令,来编译跟高级的程序。
So today is about writing some programs and empowering you to write your own starting this coming week when Pset One goes out via the website tonight by 7:00 p.m.
今天我们将要写一些程序,并且让你们,在接下来的一周写你们自己的程序,今天晚上七点,习题集1会发布在网站上。
All right so it has to live in RAM as opposed to the hard drive because otherwise things would be terribly slow as you know so it's much better if your programs live while they're running in RAM and they end up in what's called the tech segment.
好的,它存在内存中,而不是硬盘中,因为,否则程序会非常的缓慢,程序在内存中运行会好得多,它们在技术段,的地方结束。
So I wrote a little program called "chart" that, based on some data I happened to hardcode into the program, shows us their numbers for the past several years.
我写了一个叫做“图表“的小程序,基于我在程序中硬编码的一些数据,向我们显示在过去几年中我们课程的人数。
You can play not against yourself; you can program the computer to play against yourself-- you can program the computer to play against you.
你不仅能和自己对打;,也可以设定电脑程序和自己对打-,你自己玩,-你也可以设计电脑程序让你和电脑玩。
We knew this was trying to do squaring, so intellectually we know we can square -4, it ought to be 16, but what happens here?
我们知道程序是用来求平方数的,那么按理说我们可以来求-4的平方,也就是16,但是程序结果是怎么样的呢?
With simple branching, how long is it going to take to run a piece of code?
但是在简单分支程序中,执行一个程序,要多长时间呢?
It's a bad habit to get into, because when you come back to it, it may haunt you later on down the road. So really get into that notion of trying to be defensive as you program.
来运行程序的时候,错误就会出现缠住你了,因此现在我们真的要培养,在程序中有防卫性设计的概念。
应用推荐