• And in particular, I can then ask the following question, which is, what's different between those two pieces of code?

    是有个明显的模式的,我特别要问如下的问题,这两块代码的,不同之处在哪儿?

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

  • Code is right here. And all it's doing is when I'm getting into the different places I'm simply printing out information about where I am. What I want you to see palindrome is notice what happened here.

    代码就在这儿,它的作用是当我运行到不同地方时,就输出我所在方位的信息,我想让你们看的就是注意这儿发生了什么,好了我调用了一个。

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

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

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

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

  • It's the same computation. But this is a nice way of writing it, often called defensive programming.

    这跟原来的计算过程没什么不同,但这是写代码的更优秀的一种方式。

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

  • At the end of the day, you can implement the exact same program using a while loop that you can using a for loop, it's just your code is going to look slightly different.

    最终,你可以执行这个程序,再使用for循环的地方使用while循环,这只是使你的代码看起来稍微有点不同

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

  • So conceptually the key difference here, besides the syntax looking slightly different, it just means that if you want a chunk of code to execute no matter what initially, ; you can use the do while loop; if you want to check a condition first, you can use the while loop.

    所以概念上,则关键的区别是,除了语法看起来有点不同,它的意思是如果你想要一段代码,最初无论如何都要执行,你就可以用do,while循环;,如果你想要先检查条件,你可以用while循环。

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

  • And so the only two differences are, right there, and there versus here and here.

    因此这两块代码不同之处,就仅仅在于位置不同了。

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

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

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

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

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

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

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