Hello, Developers...
So, I remembered a definition I struggled with back then in CS class and I decided to differentiate so others could learn from it.
What is the difference between
Parameters and Arguments?
A lot of devs use these terms interchangeably, it's really no big deal if you're writing codes but when documenting, you want to make sure you're passing the right information across to whoever's reading your article.
Parameters are named variables which are declared during a function's definition.
Arguments are the real values passed into the functions.
As you see in the example above, the parameter in the function is the name variable passed in during the function definition while the argument is the name Samuel passed in during function invocation.
You can use this link as a reference to understand better.
Top comments (6)
I think you're still a bit off. :)
Arguments are the values passed to the call.
Parameters are the variables those values are bound to in the body of the callee.
It doesn't make sense to talk about passing variables in a language with pass-by-value semantics.
Actually no difference in what I explained and what you said unless you see something I don't.
Here :)
Okay now, I understand you.
Rather than passed, they are bound to the function. I'll edit the post.
Thanks for clarifying that.
Rather than bound to the function, the argument values are bound to the corresponding parameter variables in the body of the function. :)
Okay, noted.