"One of the really frustrating things for patients with fibromyalgia is that there's nothing to measure in labs or in X-rays.
VOA: special.2011.08.02
Now, unlike high school math or in algebra Z where you call things X and Y and Z, in programming, in computer science, you're actually dealing with humans where it's useful to have a variable name that's more descriptive than X and Y and Z.
不像高中数学或者代数中,称为X和Y和,在程序设计和计算机科学里,你实际上是在和人打交道,在这里有个描述性比xyz更强的,变量名称是很重要的。
And when you call a function, one of the things X that happens is whatever your passing in, for instance, X, ; and if this is A, this thing gets copied into A; so at that moment in time of calling increment, I actually have two copies of the same value in memory but they're referred to by different names.
当你调用一个函数,其中发生的一件事情是,不管你输入什么,比如,或者是A,它把这个东西复制到A中;,调用increment的时候,实际上在内存中,有两个同样的值的内存块,但是它们有不同的名字。
If I want to get out right now the versions of these things, I can ask what's the value of c p 1 x, and it returns it back out.
你可以在那里看到那些,代表笛卡尔坐标点的东西,如果我想要得到现在,这个类的版本的东西的话。
Even if I was that guy in the X-Men or the Matrix or whatever it was, who could reason his way into making people do things.
就算我是X-Men或者尼奥,我能影响到别人的推理
Funny story, I met him because at MIT they signed us all up for chest x-rays alphabetically-- that's the way MIT does things, an orderly way.
有趣的是,我在MIT遇到他是因为,我们按姓氏字母顺序,排队去照胸透,MIT做事总是用这种有条理的方式
Well you know what a point is, it's got an x- and a y- coordinate, it's natural to think about those two things as belonging as a single entity.
把这两个坐标认为,是属于一个独立的实体,是理所当然的事情,因此实现这个目的的。
But here, if I decide I'm going to store things not in x and y, but with some other set of names, for example, I've gotta go back into these pieces of code that use the points, and change them. So I've lost modularity.
除了要改下借口,但是这里,如果我决定,我不把值放在x和y中,而是和其他一些变量名进行绑定,例如这样的话,我就得回到使用这个点的代码,那儿去做更改了。
All right, now, that's one of the ways we could get things out, but in fact it's really not a good way.
找到x的值,好,这是一种我们可以取得值的方法,但是实际上这不是一种好方法,更好的一种办法。
Think of this as the, as the world of the interpreter, in that I've got things 3 like x bound to the value of 3.
想像一下这里就是,编译器里的世界,在这里我给x赋值为。
I've got another little thing here that I'm going to use a little later on that just prints out values of things.
给我p2的x值,对它们进行比较,就像我们通常会做的那样。
What do I have here? I need the variable, ANS, ANS I need x, and I need ANS times ANS, ANS times ANS. Right. Those are the three things that are involved in this computation.
因此让我先用这个方法做吧,我这里需要什么呢?我需要变量,还需要x,然后将ANS乘以ANS,对,在这个计算中涉及到了三件事情。
应用推荐