Well, my usual style of programming would be to implement the one that's lowest down in the hierarchy near the bottom.
一般我的编程风格是,先构建等级中最低的东西,也就是靠近地层的东西。
I took a programming class and did okay in it.
我上过一次编程课,成绩也还可以。
Now, when we talked about optimization problems in dynamic programming, I said there were two things to look for.
现在,当我们讨论,动态编程中的最优化问题时,我想说有两件事需要注意。
And I think that it kind of like went, kind of reach the point where it's my intuition now.
编程似乎成为了,我的本能。
So, I taught myself how to program because I wanted to learn how to draw a map on the screen.
所以,我自学怎样编程,因为我想,学习怎么在屏幕上画一张地图出来。
My god, this student sitting next to me was programming since he or she was 6.
我的天,坐在我旁边这位同学,6岁就开始学编程。
I like the fact that when you're computer programming,
我喜欢的一点是,编程的时候,
And I don't care if it is a programmable calculator.
我不管是否用的是可编程计算器。
So, you know, you can start writing your own kind of, Miss Manners book, if you like, I mean, are what are good programming, you know-- I wonder what you'd call them, John, good programming hygiene?
因此,你知道,你现在可以开始写,自己的女士礼仪书籍之类的东西了,如果你喜欢我这么说的话,其实我的意思是,写一些关于优秀编程习惯的东西?
So in fact, it is the case, if you look at data, and by the way, that's the way I ended up setting a lot of these parameters and playing with it, was comparing what my simulation said to historical stock data.
所以实际上,在这个例子中,如果你看到数据,顺便说一下,这就是我设置很多变量,然后编程的方式,也就是把我的仿真程序得到的结果,和历史股票数据进行比较。
This gets back to my main theme of Tuesday, which is be systematic.
我周二会把这个问题作为主题,也就是系统化编程。
3 So here what I'm doing is 17 divided by 13, but because of this parenthetical, , -- because of that parenthetical -- that has nothing to do with math; -- this is a programming language thing -- that is a casting operation.
所以这里我要做的是用17除以,但因为这样的题外话,因为那样的题外话-,还是没有做完这个数学题;,这是一个编程语言的东西-,那是一个计算操作。
But what I'm doing here is programming.
但我是在编程。
OK. Note, by the way, if I chase through each possible path, like there's some IFs in here, if there's some places to go, at least in this piece of code, every possible path through this code ends in a return. And that's a good programming discipline, to make sure that happens.
注意一下,如果我跟进每一条可能的路径,像是这里的,起码在这段代码中就有很多走向,这段代码中的每一条可能路径,在结尾都会返回一个值,这就是一条很好的编程定律,请确保这样做。
So one of the things I would like to suggest is that you develop some good style here, and in particular, don't change types arbitrarily.
所以我的建议是,你们要养成一些好的编程风格,尤其是,不要反复无常的改变变量的类型。
So I don't know, I actually spent a long time random stuff.
我就是喜欢编程,花了很多时间,设计了许多程序。
But I went away from political science because I realized that there are a lot of parallels between what you do in politics and what you do in government and writing policy and laws and what you do in programming.
但我放弃了政治学,因为我意识到,在政界和在政府里,编制政策和法律,和编程虽然非常相似。
If you want to get some input from the user, my God I don't want to have to program it to low level zero and 1 just to get keys from the keyboard; please let there have been someone who does that for me and indeed there are an increasingly sophisticated options that you can pull off the shelf.
如果你想获得一些用户的输入数据,我的上帝,我可不希望在键盘上敲入0,1的低水平方式来编程;,希望有个人能帮我做这件事吧,但是现有的选择,也变得日益复杂了。
but I've taken a lot of computer programming classes,
但是我上了很多编程课,
And I want to suggest that what we've done is, we've outlined a lot of the basic elements of programming. A lot of the basic elements we're going to need to write code.
我想提醒大家我们学习的是,我们学习了很多关于,编程的基础的东西,一些我们编写代码需要的基础的东西。
I give you a little animation that was implemented with this programming language in just a night called Raining Men.
这里有一个用这种语言编写的,叫做Raining,Men的小动画,我只用了一晚上就完成了编程。
I was deciding between political science at the time and computer science because I have always been fascinated by cities and at some point want to maybe potentially go into government I'm still not quite sure if I have more effect there or more effect in programming.
我那时要在政治学和,计算机科学,中做出选择,因为,我一直为城市着迷,我潜意识里有些想去政府工作,我并不确定我以后在,政治上更有成就还是在编程上更有成就。
and I really do enjoy computer programming.
而且我真的很喜欢电脑编程。
PROFESSOR: Last time, Professor Guttag introduced the idea of objects and classes and this wonderful phrase called object-oriented programming.
教授:上节课,Guttag教授,介绍了对象和类的概念以及,面向对象编程这个美妙的短语,这是我今天想继续讲的一个话题。
I'm not really thinking that much about it consciously.
我在编程时不会有意识地去想该做什么。
Pseudo code. Now, you're all linguistic majors, pseudo means false, this sounds like code that ain't going to run, and that's not the intent of the term. When I say pseudo code, what I mean is, I'm going to write a description of the steps, but not in a particular programming language.
伪代码,基于你们都是学语言的,伪代码意味着不正确,这听起来就像是没法运行的代码,这可不是我们学这个的目的,当我说到伪代码的时候,我的意思是要对步骤进行一个描述,而不是某种特定的编程语言。
If history is any indication 72% of the people ; in the theater have no prior programming experience; despite what you may think and despite the fact that some of you may very well be thinking, odds are I know the least about computers than anyone in here, I'm actually a little scared of my computer.
以往的经验表明,大讲堂里72%的人没有任何编程经验;,不管你们怎么想,有些人可能现在就在考虑了,奇怪的是比起在座的各位,我最不了解计算机,我甚至有点怕我的电脑。
In Scratch you may have realized that, "I could implement my program this way with these puzzle pieces, but it kind of feels -- like I could use these puzzle pieces instead" -- that's absolutely the case in programming.
在Scratch中你可能已经意识到,“我可以用这一段代码来,执行我的程序,不过这有点感觉到,我可以用这些代码段来代替“,那绝对是编程中的一个情况。
I happen to be, and John teases me about this regularly, I'm an old-time Lisp programmer, and that's how I was trained.
我很偶然的,而且John也会常常拿这个来激怒我,我是一个怀旧的Lisp编程者,而那就是我怎么接受训练的。
in graduate school I used a programming language called Perl a lot.
在研究院时,我经常使用一种,叫做Perl的,编程语言。
应用推荐