OK. What happens if you actually have something that's both syntactically correct, and appears to have correct static semantics, and you run it?
好,当你的代码语法,没错误,并且也有正确的静态语义,你去运行它的时候会发生什么呢?
All right. What do you do when you've found the bug and you need to fix it?
好了,当你发现错误并修改它们的时候,你该怎么做?记住一个古老的法则?
Okay, you're right to shout out because I'm very-- I mean doing it on the board i'm very likely to make mistakes, but okay.
你大声说出来这点很好,我写板书的时候容易犯错误
Better! So no error messages means success is probably what has happened.
好啦,错误信息消失了,这说明你编译成功了。
Wrong time, good idea, put it on the shelf.
错误的时间,好的想法,还是搁置比较好。
Well, you see iron. But this is misspelled.
好吧,你看到了铁,但它拼写错误。
It would either say something like -I'm not going to do the words that they would have come up with, but they would have said, yeah that's a good place to go or don't do that, that's a terrible mistake.
这答案不外乎两种,我不会说他们的那种语言,但是他们的意思大概是,那是个好去处,或者别做那事儿,那是个糟糕的错误
Right, it's a syntactic error, because it doesn't know how to deal with this.
好,这是个语法错误,这是因为计算机不知道怎么来解释着个。
I was expecting to compare x- and y- values, not radius and angle.
噢,发生了什么?,好吧有错误了。
All right. Why is it a static semantic error?
好,这为什么是个静态语义错误呢?
I included the length, let me go ahead and compile this program called Holloway.c. No errors which means that's good.
我包含了那个长度,我们继续,编译这个Holloway,c程序,零错误,非常好。
Let me show you one more class, though about-- sorry, let me show you two more classes of algorithms. Let's look at the next one g- and there's a bug in your handout, it should be g of n and m, I apologize for that, I changed it partway through and didn't catch it.
请大家看,额,在你们的课堂材料中有个错误,应该是g,很抱歉-,我改了一部分这个错误但是没看到这里的,好,这儿的增长率,有人想猜猜么?
I really do love these things. And is that right, John? OK, so my apologies that your handout is wrong. I did not think to check about the difference between these things.
我真的很喜欢这些东西,这样对不对John?,好,抱歉你们的课堂手册上面是错误的,我没想要要去检查,这些东西之间的不同。
So I guess I should go back, and let me do this correctly this way. Again, I can look at test, test and I guess test now if I want to get the element out-- angle bracket or square bracket?
但是这不是我想要的对不对?,我认为我该回到这里,让我改正这个错误,好,那么我还是对元组,那么现在我想从test中取出元素来?
应用推荐