Search code examples
language-agnosticparametersfunctionargumentsterminology

Arguments or parameters?


I often find myself confused with how the terms 'arguments' and 'parameters' are used. They seem to be used interchangeably in the programming world.

What's the correct convention for their use?


Solution

  • Parameters are the things defined by functions as input, arguments are the things passed as parameters.

    void foo(int bar) { ... }
    
    foo(baz);
    

    In this example, bar is a parameter for foo. baz is an argument passed to foo.