View Feed
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12831 Members
Join this group to post and comment.
Kaustubh Katdare
Kaustubh Katdare • Feb 9, 2016

Difference between parameters and arguments - are they the same?

Many programmers use the terms 'parameters' and 'arguments' interchangeably. Consider the following function -

function best_function_ever( int $param1, string $param2, bool $default = true ) 
In the above code, $param1, $param2 and $default are 'parameters'; or are they arguments? Most of the people would say there's no difference between them and they are correct. However, at times, you might be required to know the subtle difference between the terms parameters and arguments. So keep this in mind:
  • Parameters: These are the values that your function will accept, as designed.
  • Arguments: These are the actual values that you pass when calling the function.
An interviewer might just throw this googly at you during a technical interview to test your knowledge.

If you want more clarification or have doubts, post them below so that we can discuss.

Share this content on your social channels -