And will make mistakes. And therefore, you write your programs so that catastrophes don't occur when those mistakes are made.
就是人是很愚蠢的,会犯错误的,因此,你要这样设计你的程序,以达到当犯错误时避免大事故的目的。
So actually, the problem with static semantics is you'd like it to catch everything, you don't always get it.
因此实际上,你希望静态语义检查,能捕获所有的错误,但是经常结果不是这样的。
No. That's completely the wrong way to go about thinking what it's like to be a ball point pen.
并不是,这样想象圆珠笔的感觉,是完全错误的。
- But there's one potential gotcha here -- and this is where you have to be kind -- of piecing together the little clues along the way -- what have I done that's interesting here that had I not, I would have had a mathematical error?
但是这里有一个可能性-,这就是你需要把,一些线索拼凑在一起-,我这里所做的是很有趣的,如果我不这样做,我可能已经犯了个数学错误?
He can't even bring himself to say, "Thus he relates, erring," so powerful is this defense against Homer.
他就不能说“因此有关他的,都是错误“,这对于荷马的抵触是这样的强烈。
To me, that's a fundamentally wrong approach and it's actually done because it's the sort of thing that statisticians are good at.
对我来说,这是一个完全错误的途径,但实际做法就是这样,因为这正是统计学家擅长的事。
And you will be invited to make that mistake on an exam, I'm sure.
我相信在考试中你们有人肯定,会犯这样的错误。
Maybe it got mutated and its making the wrong kinds of proteins; cancer cells often do that.
它可能已经变异,产生了错误的蛋白,癌细胞往往就是这样
Another sort of task, which is a task that's been done hundreds, perhaps thousands of times, is known as "the false-belief task" and here's the idea.
另一种任务,已经被应用过了成百上千次,叫做"错误信念任务",任务是这样的
Now the part about his life in Chicago was I'm going to keep doing this, call it the novel versus the autobiography, and I'll explain why I make that mistake a little later--it was cut from the autobiography.
他在芝加哥的生活那部分,我会一直把这书叫做小说,而不是自传,我之后会解释为什么犯这样的错误,这书是从自传的一部分。
Here is the mistake some people make.
很多人都会犯这样的一个错误
That sort of thing. Makes a big difference to just get that set of eyes.
都是这样的错误,借旁观者的慧眼会对你有很大的帮助。
It's still 1, because you plus plussed the wrong symbol called X. So for now, take-away from this, don't do this.
它还是1,因为你自增的是那个错误的叫做X的符号,现在,拿走这个,不这样做。
It would definitely be wrong if we were doing this because little sanity check if you just got the single one it means what instead?
如果我们这样做就是错误的,一个小检查,如果你用单个“=“,是什么意思?
If I do this, which is kind of a mistake we made last time, if deliberately.
如果我故意这样做,这有点像,上次我们犯的一个错误。
The personality theory must be false.
这样一来人格理论一定是错误的了。
This is a fault that real estate brokers can make.
地产经纪人容易犯这样的错误
Notice if I'm going to have two different sub problems I need to have two base cases here to catch this. And if I only had one it would error out. And as a consequence, I can go off and ask about rabbits. Let's see.
我需要定义两个基础事件来处理它,如果我只有一个基础事件的话就会产生错误,这样我就能够知道到底有多少只兔子了,让我们来看看,在第12个月末,没那么简单,在第二年末兔子就很多了。
So honestly, one of the best strategies in this course and in programming in general is-- generally speaking design, but it's these little tricks of the trade that will honestly make things much more fun, much more easier, and really allow you to focus on the juicy parts of the problem and not little tiny bugs that you may have started tripping over already.
说实在的,这堂课在编程方面最棒的策略之一,简而言之,就是--设计,但这只是一些让事情更简单,更容易的小技巧,让你专注于问题的核心关键,而不是一些可能让你绊倒的,这样或那样的小错误。
应用推荐