0

Assuming I have this code:

function question($argument)
{
    var $q = "What does ($argument) mean?";
}

Can any tell me is there any other word (or phrase) that defines what an argument is? I'm asking this because English is my second language, and I can't for life find a word in my language that defines "argument" in "programming".

I understand how arguments work, and what they are for, I just need a synonym word or phrase to be able to translate it to my language to make it easy to use and understand.

The best thing that I came up with (in my language) is (Passed Variable(s)), does that sound right? Is there any better wording?

Thanks

mu is too short
  • 426,620
  • 70
  • 833
  • 800
XO39
  • 481
  • 2
  • 9
  • 22
  • 1
    Passed variables sounds fine to me. Alternatively how about "input information" for the function. – wim Aug 31 '11 at 05:18
  • Yes agreed that passed variables is fine. I actually also like input information wim. Really brings me back to basic math functions such as f(x). :-) – Vinay Aug 31 '11 at 05:20
  • Maybe there is a translation of [this Wikipedia page](http://en.wikipedia.org/wiki/Mathematical_argument) in your native language. – mu is too short Aug 31 '11 at 05:23
  • @wim: "input information" sounds interesting although I'll have to use three words in my language (too long), but I'm thinking about "input data" or "input variables" as an alternative for "passed variables", does that sound correct? – XO39 Aug 31 '11 at 05:33
  • @mu is too short: unfortunately, there are no enough info in my language on the Wikipedia page you posted. :( – XO39 Aug 31 '11 at 05:36
  • Maybe include your first language in your question, someone else that speaks it may come along. – mu is too short Aug 31 '11 at 05:39
  • See also http://stackoverflow.com/questions/156767/whats-the-difference-between-an-argument-and-a-parameter – Mechanical snail Aug 21 '12 at 01:39

5 Answers5

3

Parameters

Does that help?

("Passed Variables" is close ... and might work fine in your language)

Brian Roach
  • 76,169
  • 12
  • 136
  • 161
  • Thanks for your answer. But parameters also means another thing and can't really used (in my language) for what arguments mean. I guess I'll just stick with "passed variables" for now, unless someone suggest a better solution. :) – XO39 Aug 31 '11 at 05:26
  • Might also want to make the distinction between _formal parameters_ and _actual parameters_ http://en.wiktionary.org/wiki/formal_parameter , http://en.wiktionary.org/wiki/actual_parameter – Wes Aug 31 '11 at 05:28
2

On the calling side it's an argument, on the function side it's a parameter.

"Parameter" vs "Argument"

Community
  • 1
  • 1
Daniel Pereira
  • 1,785
  • 12
  • 10
2

I wouldn't use "passed variable" because arguments do not have to be variables.

Perhaps the most common usage of the term is seen in this example. Consider

// A function definition
function f(x, y) {
    .... 
}

// A function call
f(57/p*q+4, z);

Most people would call x and y parameters, and call 57/p*q+4 and z arguments. Note that parameters are variables (unless the language has pattern-matching, not too common) and that arguments can be arbitrary expressions.

Now you may hear people call x and y "formal parameters" while the arguments are "actual parameters" but IMHO this distinction is a little old-fashioned. I may be wrong though.

The thing is that the argument is the expression that is passed to the parameter in a function call. So maybe "passed expression" is better than "passed variable" at the very least. Have fun translating. One fun thing about the vocabulary of computing is that almost every word (function, procedure, type, label, constant, variable, expression, declaration, statement, operator, argument, parameter, etc.) is just borrowed from a plain old English word. There aren't too many novel terms.

Ray Toal
  • 86,166
  • 18
  • 182
  • 232
  • If you want to get super pedantic you can even say that not all definitions of parameters and arguments are in the plural (when talking about lambda calculus). So the definitions get even more vague. – Wes Aug 31 '11 at 05:42
  • @Ray Toal: Yes, agreed about the computing vocabulary. As for "passed expression", it can't be used (in my language) for "argument", maybe "passed data" or "passed info" will more accurate? What do you think? – XO39 Aug 31 '11 at 05:43
  • Both are just fine. Also perhaps you can work into your translation something about how when the function is called the value (or reference or name, depending) of the argument **replaces** the parameter. – Ray Toal Aug 31 '11 at 05:48
1

An argument is what you pass into a function (also known as a subroutine). Arguments are also known as parameters. A function might take an argument and use it to calculate something or modify the argument itself.

Vinay
  • 6,204
  • 6
  • 38
  • 55
0

Arguments are the variables of the functions that works during calling them. And parameters are also the variables of the functions that works during returning value to the program by that function.