Using the terms in a consistent manner can avoid confusion. I tell beginning programming students that a Parameter is like a "Placeholder," and the Argument is the "Actual" value that fills it in, emphasizing the first letters of each.
It's nice to know this distinction when you're working with other people who expect this distinction to be followed.<p>Personally, I prefer the softer explanation in Wikipedia that begins, "The terms parameter and argument are sometimes used interchangeably, and the context is used to distinguish the meaning."<p><a href="https://en.m.wikipedia.org/wiki/Parameter_(computer_programming)#Parameters_and_arguments" rel="nofollow">https://en.m.wikipedia.org/wiki/Parameter_(computer_programm...</a>
One also finds the terms "formal parameter" (for what is called a "parameter" in the article) and "actual parameter" (for what is called the "argument" in the article).<p><a href="https://en.wikipedia.org/wiki/Parameter_(computer_programming)#Parameters_and_arguments" rel="nofollow">https://en.wikipedia.org/wiki/Parameter_(computer_programmin...</a>
Could someone offer a good explanation as to why it matters in this specific case? I can't think of any way in which a lack of knowledge of the "correct" term could lead to something being done incorrectly.
Does it really matter?
This is the sort of thing that I would expect to come up in some pedants interview question - it has very little with being able to use the features effectively.
One easy way to remember which is which: Recall the term "command line arguments." That will remind you that arguments are what's passed to the function. So, parameters are what's declared/defined in the function.
"A Parameter is a variable in the signature of a function declaration or definition:"<p>int main (int argc, char <i></i>argv)<p>public static void main(String[] args)<p>static void Main(string[] args)<p>sys.argv<p>Wait a minute...
This, like basically all terminology/jargon distinctions, will be community-specific. This particular distinction is idiomatic primarily in the C family (C, C++, Java, ad n.), primarily inheriting from the declaration/definition distinction in the ancestral language. But jargon has dialects---some people will have seen declaration/definition above and now be itching to correct me with 'prototype/implementation'. In other development communities (say, lispers), the terms may be different, the distinction may not exist or a different one might take priority (like, say, car/cdr). As others have said, what matters is clarity of communication, and part of that is always learning the idiom and norms of your community. Note: in many cases there might be a published standard (eg. K&R C, or Academie Francais French), which can inform usage, but not necessarily prescribe it.
Then there's Common Lisp, where a variable is assigned only the first time it's defined, while a parameter is assigned every time its definition form is evaluated: <a href="http://clhs.lisp.se/Body/m_defpar.htm" rel="nofollow">http://clhs.lisp.se/Body/m_defpar.htm</a>.
I’ve also seen and used terms like “option” for command-line values, or “bare argument” for values that are not tied to anything in particular. And in code, if the documentation uses hooks like "@param" then people will naturally think of those as parameters. You can also refer to individual fields of a data structure as “parameters” even if they are passed to a function as one value (and I have never seen people refer to fields as “arguments” in that situation).<p>In the end, I don’t think any term is used consistently enough. People will use whichever words they want, and you have to treat them all as potentially referring to the same thing.
I like to phrase it like this: “A parameter is a local variable that's initialized by passing an argument”. That works for functions and C++ templates. It also works in languages like ML, where you can initialize multiple parameters from a single argument (via pattern matching).<p>Consequently, speaking of “passing a parameter” is dead wrong most of the time, except maybe when you're writing a function that “defines” other functions, where a parameter of the function to be defined is an argument of the definer function. But I will stop here before it gets complicated.
Does that really correspond to usage in mathematics? I think that can be where the confusion comes from.<p>Let's say: "Here we define a function f(x,y) of two arguments x and y.."
Wait, don't we have an <i>arguments</i> object in JavaScript that ["is an Array-like object corresponding to the arguments passed to a function."](<a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Functions/arguments" rel="nofollow">https://developer.mozilla.org/en/docs/Web/JavaScript/Referen...</a>)