What's the difference between an argument and a parameter?

后端 未结 30 1871
北恋
北恋 2020-11-22 01:08

When verbally talking about methods, I\'m never sure whether to use the word argument or parameter or something else. Either way the other people know what

30条回答
  •  甜味超标
    2020-11-22 01:57

    In editing, I'm often put off at how people forget: structure languages are based on natural languages.

    In English

    A "parameter" is a placeholder. They set the response format, in spoken language. By definition, it's party to the call, limiting the response.

    An "argument" is a position that is being considered. You argue your opinion: you consider an argument.

    Main difference

    The thematic role of an argument is agent. The thematic role of parameter is recipient.

    Interactions

    Think of the argument as the male part, making the parameter the female part. The argument goes into the parameter.

    Usage

    A parameter is usually used in definitions. An argument is usually used in invocations.

    Questions

    Finish the sentence to make it less dissonant.

    (A) Speaking of a definition:

    1. What argument will be used []?
    2. What [] will this parameter []?

    (B) Speaking of an invocation:

    1. What parameter will you use, []?
    2. What [] will be [] this parameter?

    Answers

    (A)

    1. on/in/against/with this parameter
    2. argument(s) ... take

    (B)

    1. and what are some example arguments
    2. argument(s) ... used on/in/against/with

    Overlaps

    As you can imagine, after answering: in spoken language, these words will sometimes produce identical responses!

    So, as a rule:

    • Usually if someone wants parameter information, they want to know more about the type, the variable name, etc. They may become confused if you only give example arguments.

      • Usually if someone wants argument information, they want to know what value you passed to a function or its parameter(s).

提交回复
热议问题