长的具有描述性的方法和变量命名是比较好的。
是不是所有的变量命名的前缀都有指示它们长度?
Do all variable names have prefixes which indicate their size in bytes ?
如果你把一个变量命名成loader,那你是成心自找麻烦。
If you're using a variable named loader you're just asking for a Javascript smack down.
All right, c p 1 dot y, x I've said assign that to the value 2, 2,0. So now c p 1 has inside of it an x and y value.
一个特定的版本,我现在命名了一个内置变量,并给它赋值了,我刚刚做的也就是给它。
OK. The other piece I want to say about variable names is, once I have that choice of variable name, I can use it, but in fact there are a few things that I can't use in terms of variable names.
关于变量名字我还想说的,另外一点就是,一旦我对变量的名称可以选择,我可以用自己的方式命名,但是,有一些词汇是,不能用来命名变量的。
Let me write a function, in fact the literal thing I would do is to say, identify the things that change, give each of them a variable name because I want to refer to them, and then write a function that captures the rest of that computation just with those variable names inside.
让我来写个方法,实际上我的意思是,辨别出变化的东西,然后给它们逐个命名以区分,然后写一个用来计算,这些变量的,包括计算过程的方法。
应用推荐