• And notice because I have just one line of code inside of each of these branches, what have I clearly omitted?

    请注意因为我每个分支只有一行代码,显然地我省略了什么?

    哈佛公开课 - 计算机科学课程节选

  • And in the process of tidying it up and making it prettier, I'll often by accident find the bug.

    让我的程序更漂亮些,这个清理美化代码的过程,我常常无意发现我的错误。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • I want the function, which is a little tool, a line of code I can include in my own programs and generally those tools live in sections two or three of the manual.

    我想要一个函数,那是一个小工具,我程序可以包含的一行代码,通常这些工具手册的第二节,或第三节。

    哈佛公开课 - 计算机科学课程节选

  • Now we're gonna hand you some framework, that code that we wrote with some blanks to get you accustomed to the idea of one, writing larger programs than time might allow if you were doing it on your own.

    就提供给你们一些框架,在代码中有些空白,是为了让你们了解其的思想,如果是你自己,若时间允许,那就尽量写大的程序。

    哈佛公开课 - 计算机科学课程节选

  • But I got a couple of other of these strange looking things in there with underbars to them.

    我可以这片代码中看到这些,然后我需要一些可以给我,返回这些信息的东西,但是这里还有一些看起来。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • What does that say? It says if in the code up here I get an exception of that sort, I'm going to go to this place to handle it.

    这意味着如果在代码中,我得到一个这样的异常,我能到这里来处理它。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • And henceforth I'm gonna start calling these tools, these monickers that I can use as building blocks in my own program, it's gonna be called a function as we'll see.

    从此以后,我将我的程序里把这些工具,称为我们可以用来写代码的组件,我自己的程序,我们将了解到它被叫做为一个函数。

    哈佛公开课 - 计算机科学课程节选

  • Suppose I want to compute square roots a lot of places in a big chunk of code.

    假设我想一大段代码中,计算很多次平方根。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • So if you're coming from prior background, your code might work a little differently on a different system if you don't use those flags.

    如果你来自一个先前的背景,如果你们没有使用这个版本标志的话,一个不同的系统,你的代码可能运行地不太一样。

    哈佛公开课 - 计算机科学课程节选

  • You need to, if you want something to be printed out inside your code, you need to tell the machine to do that.

    你需要,如果你想要,在代码中显示一些东西的话,你需要告诉机器这么做。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • > That lets the compiler know that you want to use some actual compiled code from that library.

    >,那是告诉编译器我们想要程序库,使用一些当前的编译后的代码

    哈佛公开课 - 计算机科学课程节选

  • The only thing that compiler needs to know is kind of what pattern to look for in the rest of your code.

    编译器需要知道的唯一的东西是,用来剩下的代码中寻找的函数形式。

    哈佛公开课 - 计算机科学课程节选

  • We hand you a bunch of programming code that we wrote because this is very much the norm in the real world.

    我们给你们一些我们自己写的代码,因为现实世界这都是非常正常的。

    哈佛公开课 - 计算机科学课程节选

  • Now you have a set of parentheses as we'll see int i=0 in actual code and then I have int I equal 0.

    你将会实际的代码中看到一对圆括号,比如,我们让。

    哈佛公开课 - 计算机科学课程节选

  • Because if I don't specify a name for this input, I have no way of actually referring to it in subsequent lines of code.

    因为如果我不给这个输入定义一个名字,随后的代码中,我就没有办法使用它。

    哈佛公开课 - 计算机科学课程节选

  • Because there will not be time to look at that code for the first time during the quiz, and figure out what it's doing.

    因为考试,是没有时间去第一次看代码,并弄懂它的意思的。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Give you some examples. What have we talked about? We've talked about things like using comments to highlight what you're doing in the code, to make it easier to debug.

    给大家举些例子,我们一直强调什么来着?,我们讲过要用注释来说明,你在代码中进行的操作,以便于调试。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • I want to just use it, I shouldn't have to worry about what variables I use inside of it, I have shouldn't have to worry about where that is in the code, I should be able to just abstract it away. And that's what we want to add today, are those two things.

    我只是想使用它,我不用考虑我这段代码中,使用的是什么变量,我完全不用考虑代码的内容,只要抽象就好,我们今天想补充的内容就是这两点。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • And now in a sentence, what does this one actually do?

    句子可以看出,这行代码做了什么?

    哈佛公开课 - 计算机科学课程节选

  • bugs That is a problem that may not terminate.

    随机的在代码中去搜寻。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • stdio h This file here is called standard I/O or stdio.h and this is just another text file someone else wrote many years ago and by using that line of code there, I'm telling the computer, give me acces to this code that this other person wrote that's in that file.

    这里的头文件称为标准输入输出文件或,这是由某位前人编写的文本文件,我们只需要刚才所述的一行代码,就能告诉电脑,让我连接到,这个前人那个文件写的代码

    哈佛公开课 - 计算机科学课程节选

  • Because what you don't see in this file is any code a that actually says put a letter of the alphabet at the top left hand corner of the screen and then put the next character to the right in other words, I'm taking for granted at this moment in time that my computer knows how to print something to the screen.

    就是这些你本文件看不到的一些代码,实现了将首字母,放屏幕的左上角,然后把其他字母加其右边,我想当然地认为,我的电脑知道如何打印相应信息到屏幕上。

    哈佛公开课 - 计算机科学课程节选

  • I stress it in particular because I know you're all going to get into this stage; you've got a problem set due in a couple of hours, you're still writing the code, you don't want to waste time, and I'm going to use quotes on "waste time", doing those extra things to do the defensive programming, you just want to get the darn thing done.

    我特别强调了这一点,因为我知道你们都会慢慢成为程序员;,你代码过程造成了一系列的错误,你还代码,你不想浪费时间,我想把“浪费时间“用引号圈起来,浪费时间来做因为防卫性程序设计,而带来的这些额外的事情,你只想赶紧把程序写完,这不是一个好习惯,因为当你做完回头。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • Remember last time, I said that there's different kinds of complexity in our code, and I suggested for simple branching programs, the amount of time it takes to run that program is, in essence, bounded by the number of instructions, because you only execute each instruction at most once.

    但是这里有个很重要的点,记得上节课,我提过我们的代码中,有不同种类的复杂度,而且我还说了对于简单的分支程序,运行这种程序需要的总体时间,大体上,是和指令的数目相关的,因为每个指令只会被执行最多一次。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • 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.

    注意一下,如果我跟进每一条可能的路径,像是这里的,起码这段代码中就有很多走向,这段代码中的每一条可能路径,结尾都会返回一个值,这就是一条很好的编程定律,请确保这样做。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • If I go back to that code from a moment ago, and I just rerun math3, notice how many places printed after the decimal point -- two?

    如果刚才我回到那段代码中去,我们回到math3,请注意小数点后面,会打印几位数呢--两位?

    哈佛公开课 - 计算机科学课程节选

  • 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.

    组合成为有意义的单元,那么这就让我们回到,一开始讲的话题之一了,这就是抽象的概念,也就是我可以以一个简单的,实体的形式创建这样的一个单元,把具体实现隐藏然后写一些,真正模块化的代码,我们以后的课程

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • And that shows you one other nice little thing we want to do, which is if I look in this code notice I set up a variable up here called false Solution Found, initially bound to false.

    这显示了我们想要做的另一件事,那就是我这段代码中设置了一个,名为Solution,Found的变量,初始值设为。

    麻省理工公开课 - 计算机科学及编程导论课程节选

  • 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你可能已经意识到,“我可以用这一段代码来,执行我的程序,不过这有点感觉到,我可以用这些代码段来代替“,那绝对是编程的一个情况。

    哈佛公开课 - 计算机科学课程节选

  • In temp. So that means at the end of that first line of code just as before the value of 1 ends A up in a variable called temp because we said go to A and I look around, oh, there's A, what's there?

    temp第一行代码的末尾,值1最终到了叫做temp的变量,因为我们指明了定位到,并且四处查看,哦,这里是A,里面是什么?

    哈佛公开课 - 计算机科学课程节选

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定