When reading the documentation, reading technical articles, or dealing with anything programming related you’re going to come across both parameters and arguments.
Sometimes, people will use these phrases interchangeably. For what it’s worth, I think that’s okay. People know what the speaker or author is referring to when they are using these terms.
But there is a difference between the two. So if you find yourself in a situation – maybe an interview or a setting that requires a bit more precision – here’s the difference.
Parameters and Arguments
First, let’s take an example from the WordPress code reference for a given function and let’s look at its parameter list.
add_user_meta, the parameters are:
- And an optional
So what distinguishes these from being called arguments?
Parameters are the values the function accepts. Arguments are the values passed to the function.
That’s all. So when you’re talking about a function and the allowed values, those are its parameters. When you’re writing code, and you’re passing specific values into a function, those are arguments.
The Difference Between Parameters and Arguments was written by Tom. For more information about WordPress, development, and resources then visit Tom McFarlin’s blog.
Read more here:: The Difference Between Parameters and Arguments