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

后端 未结 30 1882
北恋
北恋 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:56

    Logically speaking,we're actually talking about the same thing. But I think a simple metaphor would be helpful to solve this dilemma.

    If the metaphors can be called various connection point we can equate them to plug points on a wall. In this case we can consider parameters and arguments as follows;

    Parameters are the sockets of the plug-point which may take various different shapes. But only certain types of plugs fit them.
    Arguments will be the actual plugs that would be plugged into the plug points/sockets to activate certain equipments.

提交回复
热议问题