loading...

Parameters and Arguments..the difference

samuelorobosa profile image Samuel Amagbakhen ・1 min read

Hello, Devs...

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.

  1. Parameters are named variables which are declared during a function's definition.

  2. Arguments are the real values passed into the functions.

Alt Text

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.

Posted on by:

samuelorobosa profile

Samuel Amagbakhen

@samuelorobosa

I am a developer with a passion for building things that live and breathe on the web. I love taking on new projects.

Discussion

markdown guide
 

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.

 

Parameters are variables passed into a function

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. :)