• Condition," this thing in the middle between the semicolons, is going to be checked every iteration of the loop.

    条件,“这个在两个分号的中间,它将迭代地检查这个循环的条件。

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

  • It ultimately evaluates that line of code but just once the stuff inside the curly braces, but the semicolon on the end, essentially has the effect of this.

    它最终执行了那行代码,但是只有一次,当那个东西在花括号里,分号放在后面,本质上影响了这个循环。

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

  • You do need to know how to use it, but it's not about the details of, where do the semi-colons go in Python. All right?

    你们确实需要知道怎么使用它,但是并不是具体细节,比如在Python中怎么写分号,好么?

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

  • So again immediately on first glance, a little more arcane, there are some distracting details, these curly braces, the semicolon, the quotation marks.

    第一眼扫过去,是不是有点神秘,有点繁琐,还有一些莫名其妙的大括号,分号和引号呢。

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

  • Right. So similarly, if you've got one line of code with a semicolon at the end saying, this is the end of the statement, it doesn't really make sense to continue that conversation to try to continue conceptually that puzzle piece with curly braces.

    对的,类似的,如果你得到了一行代码,后面有一个分号,标志语句的结尾,这就没有意义来继续,那个会话来尝试对那段代码,使用花括号。

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

  • And then there are some stupid syntax like curly braces and semicolons that initially are kind of annoying because you have to remember where all this junk goes.

    还有一些像大括号和,分号之类的愚蠢语法,最初是很讨厌的,因为你需要记得它得放到哪里。

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

  • Case in point: there's no semicolon here, there's no semicolon here, there's no semicolon here.

    恰当的例子:这里没有分号,这里也没有分号,这里也没有。

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

  • But what does the -- what is the effect of that semicolon would you conjecture?

    但是你们推测,这个分号有什么影响?

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

  • And, in fact, it kind of looks like a function, and yet here's a semicolon I just said that can get you into trouble, and yet that's not actually a function, because there's no interesting lines of code, because it turns out the interesting code is down here at the bottom.

    实际上,它有点像一个函数,并且这里有一个能够使你陷入麻烦当中的分号,那个事实上也不是一个函数,因为这里没有有用的代码,因为,有用的代码都在底端。

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

  • In every example thus far we've had a semicolon saying that's our initialization.

    在每个例子中,有我们有一个分号来指明,那是我们的初始化。

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

  • The semicolons are where they could be or should be.

    这些分号放在它应该放的地方。

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

  • J++ Now here's the semicolon, J less than N, where N is this, J plus, plus; so what am I doing?

    现在这里是一个分号,J小于N,N是这个,那么我在做什么?

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

  • But a semicolon thereafter is sufficient.

    但是其后的分号是足够的。

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

  • And even though the syntax, the characters you are about to see on the screen and in programs today onward is a little more arcane, it's a little uglier looking, you've got semicolons and parentheses and fairly arcane syntax, realize that at the end of the day these are just arbitrary human conventions, the ideas are identical to this thing here.

    可能你在屏幕上,编程中见识到的,语法,字符看起来非常晦涩难懂,甚至可以说是丑陋,像什么分号啊,括号啊等等,还有一些难七八糟的语法,但是到了最后,你会发现,这些都不过是一些人为约定而已,而蕴含在里面的编程思想跟这个例子并无二致。

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

  • And generally in this language called "C" as well as a lot of others, almost all of your lines have to end with semicolons, but not all; just almost all and we'll see the difference.

    通常在这个“C“语言中,像其他的语言一样,几乎所有的你们的代码行都要以分号结束,但不是所有的,只是大部分的,我们将看到他们的区别。

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

  • I'm going to call it int *y enter or, sorry, semicolon, and then what if I do this?

    我把它叫做int,*y,回车,抱歉,分号,如果我这样处理,会发生什么?

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

  • And so what I was hinting at earlier when you put semicolons in the wrong place, and then proceed to have curly braces around arbitrary lines of code, you're creating an even more local scope there, which is generally not the right intended behavior.

    在之前我暗示了,当你把一个分号放在错误的地方时,然后开始用花括号,括上任意行的代码,你在那里创建了一个局部范围,那个不是故意的行为。

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

  • So it's these little differences that you'll very quickly acclimate to but it's these stupid little syntactic details that trips off, especially those less comfortable early on because if you leave out a single character, namely that semicolon on the right hand side, nothing will work.

    你会很快适应这些,微小的区别,但我们正是要把这些罗里吧嗦的语法细节,尤其是那些让人非常头大的句子啃下来才行,因为如果我们一旦遗漏掉某个符号,譬如一个分号,从另一方面看来,很有可能什么都工作不了。

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

  • The semicolon just separates this from the rest.

    其中的分号只是用来间隔两条语句。

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

  • So it's definitely the semicolon.

    它当然是一个分号

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

  • The semicolons to terminate lines.

    分号标志一行的结尾。

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

  • So really, the rule of thumb if you think back to Scratch is -- that any time you write a statement -- -- something that does something in one line of code -- you generally need the semicolon there.

    实际上,根据经验,你们回忆一下在Scratch中,任何时候你们写一条语句-,处理一些操作的一行代码-,你们通常需要在那里加个分号

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

  • Because the for loop hands me placeholders in between those semicolons for variables and such, now I don't have those with while loops.

    因为for循环给我提供了为变量准备的占位符,它们在分号之间,现在在while循环中,我没有这些。

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

  • For some reason I had this backslash N, a close quote, parenthesis, semicolon, close curly brace.

    由于某些必要原因,我们还得加上\n,后引号,圆括号,分号,后大括号。

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

  • So in other words, if you terminate these lines early, if you terminate the four loop early, if you terminate an if condition early with that semicolon, the code may very well work; and this is a common source -- of frustration and conundrum because you don't -- because your code looks right and yet it's misbehaving, but that semicolon means stop looking for subsequent lines of related code.

    换句话说,如果你用分号过早的终止了这些代码行,如果你过早地终止了那个for循环,如果如此,一个if条件,代码可能可以运行,这就是,挫折和问题产生的源头,因为你没有-,因为你的代码看起来是正确的,但是运行是错误的,那个分号的意思是,停止寻找后面相关的代码。

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

  • But at the end of the day, the point of the slides is not to expect you to now go write programs in C but really to just remind you that, hey, if you ever get distracted from some of the minutia that is the semicolons, parentheses, and what is very new to many of you, it's really no different than the fun and games we implemented with Scratch last week.

    但是最终,我们课件上讨论的主题,并不是让你现在就写一个C语言的程序,而是要告诉大家不要你被那些分号括号,还有一些从未见过的符号等一些细节搅得心烦意乱,因为它们本质上,和我们上周用Scratch做出来的游戏,并无区别。

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

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

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

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