I could imagine writing another function for same point, and I have to give it a name like same point polar, and same point Cartesian.
程序不知道怎么来做了,它没有对应的处理方法,所以它要抱怨了,那么我这里的问题就是,这也是我一直想要说的。
The only thing that you have to put in the function prototype, ; again, is three things; one, the name of the function; the return value; and its arguments.
你唯一要加入到函数原型中的东西,是有三个东西,一,函数的名字;,返回值,和它的参数。
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.
让我来写个方法,实际上我的意思是,辨别出变化的东西,然后给它们逐个命名以区分,然后写一个用来计算,这些变量的,包括计算过程的方法。
And just as with variables, you should use some common sense, some style here, and the function's name should X Y communicate what it does, calling it X or Y or Z is generally not all that helpful.
就像变量,你使用一些常识,一些类型,和函数名需要,传达它所做的事情,把它叫做,或者Z通常是没有什么用处的。
应用推荐