This is a question about nomenclature, which I hope is on-topic here on meta. I believe it is: since my last question it became clear to me that answerers here are, above all, educators ("we're teaching people in a lot of ways, helping them and us at the same time"). My background is in life sciences, and because of that I always pay attention to the correct use of the nomenclature and terminology, not because I'm obsessed by nomenclature but because I believe that the correct use of the terms allows us to communicate clearer and avoids misunderstandings — which are very important here at CR.
My issue here is the use of the term parameter. Expressions like "passing a parameter" or "passing a parameter to a function" are quite common: on Google, the search "passing a parameter to a function" (with quotes) returns over a hundred thousand results. Here on CR the search "passing a parameter" (with quotes) returns 14 results.
However, the way I understand it, we can never pass a parameter to a function. We can only pass arguments.
So, given this very basic example (in JavaScript):
function double(number) {
return number * 2;
};
console.log(double(20))
//returns 40
Here, number
is the parameter in that function. It's hardcoded on the function definition: we cannot pass it. What we can pass are the arguments (in this example, 20
), which is the value the parameter will assume.
If that's correct, those questions asking about "passing a parameter" (and the answers using the same expression) are not exactly clear, and should be edited.
In conclusion, these are my questions:
- Am I being too draconian here? Is the expression "passing a parameter" acceptable? Those 100,000 results on Google make me think that it is acceptable.
- If "passing a parameter" is inadequate indeed, can we suggest edits, changing it for "passing an argument"?
def f(x): return g(x)+1
, the parameterx
is passed to the functiong
. It's just that the parameter isn'tg
's parameter, it'sf
's. \$\endgroup\$ – Challenger5 Jan 12 '18 at 4:54