Those two terms are often used interchangeably but we want to be precise when describing concepts like how parameters work and how argument are passed.
A parameter is the variable used during the method definition.
An argument is the actual value of this variable that gets passed to the method during method invocation.
def my_method(my_parameter)
# Do stuff
end
my_argument = "I'm an argument!"
my_method(my_argument)
Mnemonic Tips
Glanned by yours truly around the Cyberspace:
- Argument are Actual.
- You define parameters and you make arguments. 1
- You can think of the parameter as a parking space and the argument as an automobile. Just as different automobiles can park in a parking space at different times, the calling code can pass a different argument to the same parameter every time that it calls the procedure. 2