OK. What happens if you actually have something that's both syntactically correct, and appears to have correct static semantics, and you run it?
好,当你的代码语法,没错误,并且也有正确的静态语义,你去运行它的时候会发生什么呢?
Just as you are making decisions about your life, where you need to go and what needs to happen next.
当你正在为自己的人生做决定的时候——你要去哪儿?接下来又会发生什么?
Well, you'll know when it crashes, that doesn't help you very much, but you can't always tell whether something's stuck in an infinite loop or whether it's simply taking a long time to compute.
好,你将学到它在什么时候会崩溃,这对你帮助并不大,但是你不能辨别出到底是在一个循环中,有什么东西卡住了呢,还是程序需要很长的时间来计算一个结果呢。
When and why, you may ask, did this differentiation occur?
你也许会问,什么时候,为什么有这种区分的发生?
Now, why the Fat Lady? It's this mythical, incredibly humanly embodied-- whenever you see a fat lady in a novel, one of the first things you want to ask is: why does that person need to be excessively embodied?
现在,为什么是胖太太,这是个神话,人们呈现了,无论你什么时候看到一个胖太太,在小说里,你首先会想问:,为什么那个人需要被这样过多的描写呢?
This is what--this is where the humor for that baby comes in, which is you couldn't predict when the sound was coming and some aspect of that was what made it so funny then, what elicited the laughter.
这就是…,为什么那些婴儿那么好笑,因为你猜不到他们什么时候会笑,因此我们才觉得好笑,引起我们大笑。
And just when you wake up, think, "Right, what do I want to wear today?"
当你醒来的时候,会想,“对了,今天我想穿什么呢?”
The fact that you could die and you don't know when you're going to die doesn't yet entail that you could die at any minute, at any moment.
你可能会死和你不知道,自己什么时候会死这个事实并不能得出,你可能随时随刻死的结论。
Do you know when people usually dress like that?
你知道什么时候人们会打扮成那样吗?
When do you feel you are lucky?
你什么时候会觉得自己幸运呢?
Top-down processing is an example of when you know what something is you hear it that way.
举例来说,自上而下加工就是,当你知道某句话是什么的时候,你便会按照这句话去听
That goes back to that idea of sort of discipline coding. It's easy to have assumptions about what you think are going to come into the program when you writ it. If you really know what they are use them as search, but if you think there's going to be some flexibility, you want to prevent the user getting trapped in a bad spot, and exceptions as a consequence are a good thing to use.
这又回到了规范编码的想法上来了,在你写代码的时候考虑,什么会进入你的代码的思考是简单的,如果你真的知道,他们是用他们来做搜索的,而你希望有一定的灵活性,你想要阻止用户,陷入一个艰难的境地,那么异常是非常实用的。
应用推荐