And then what I get to do inside the curly braces is literally line by line enumerate the cases that I want to apply to the following code.
然后我们在花括号中要做的是,逐行地列举接下来我想要,应用的代码。
And in particular, I can then ask the following question, which is, what's different between those two pieces of code?
是有个明显的模式的,我特别要问如下的问题,这两块代码的,不同之处在哪儿?
And the robot or the computer or what have you is just automatically, mechanically following the code commands of the program.
那些机器人,或叫做计算机等等,只是自动地,机械地执行程序的命令代码
You can say if this is true, then go and do the following pieces of code or puzzle pieces that are inside this part of the block, else go ahead and do these that are down here.
你可以说如果条件成立,执行下面的代码段,或板块中的拼图,否则跳过去执行这下面的语句。
That code says the following: the IF says, I've got an expression, I'm going to evaluate it.
代码的含义是这样的:,我有一个表达式,我会去对这个表达式求值。
What that basically says is the following: in an interpreted language, you take what's called the source code, the thing you write, it may go through a simple checker but it basically goes to the interpreter, that thing inside the machine that's going to control the flow of going through each one of the instructions, and give you an output.
也就说,如果是解释语言的话:,你要写一些叫做,源码的东西,你写的东西会经过一个简单的过滤器,然后解释器会处理你的源码,解释器会产生一个,逐条读取你的源码的,控制流,然后返回一个输出结果。
Anytime you find yourself in this pattern, odds are, what you're doing is a candidate for being factored out, hierarchal decompositions is the buzzword you'd see in the textbooks if you're following along with any of them, but it's really just the idea of taking out common code and putting it into just one place.
任何时候你发现你处于这种模式中,可能,你所做的东西是可以提取改进的,体系分解是一个你在课本中看到的流行词,如果你遵循其中一个,这个实际上是一个把相同的代码,放到一个地方的思想。
应用推荐