I'm thinking about a problem, I'm going to show you an example in a second, first thing I'm going to do is say, what is the thing that's going to change every time I run through the same set of code?
我要解决一个问题,我马上会让大家看一个例子,第一件我要做的事情就是,弄明白每次运行同样的指令集时,每次都会改变的东西是什么?
And that does two things: bug one, it helps catch bugs in your code, and secondly it often converts it into a more efficient sequence of instructions before you actually go off and run it. All right?
这有两点好处:,第一是可以帮助你发现程序中的,第二是把你的代码,在运行之前,转换为更有效率的指令的集合,对不对?
It's a little more involved on a PC but it's all free, the software you can download, and Linux in similar operating systems generally come with a compiler or you run a simple command to get it.
在PC机上有点复杂,但是它是免费的,你一般下载的软件,类似Linux的操作系统等等通常都需要,一个编译器,或者你可以运行一些简单的指令来获取。
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.
但是这里有个很重要的点,记得上节课,我提过在我们的代码中,有不同种类的复杂度,而且我还说了对于简单的分支程序,运行这种程序需要的总体时间,大体上,是和指令的数目相关的,因为每个指令只会被执行最多一次。
I'm gonna run the command called Nano which is a very simple program.
运行名为“Nano“的指令,这是一个非常简单的程序。
应用推荐