Talk:Parameter (computer programming)

message: There are no sources for the article. Could someone please provide a source for the distinction between parameters and arguments? Otus (talk) 18:39, 11 June 2008 (UTC)
replies: text: I've been a PhD computer scientist for over 20 years, and I'm also an amateur stickler about English word usage.  I have never seen the rigid distinction between "parameter" and "argument" that this article attempts to make.  On the contrary, the terms "formal parameter" and "actual parameter" are well established terms in computer science and have been for decades, thus clearly suggesting that a "parameter" is not necessarily only a formal parameter.  This article needs to be re-written to remove this misleading distinction between "parameter" and "argument".   -- DBooth (talk) 17:17, 8 February 2012 (UTC)

text: For example, see Formal and Actual Arguments  -- DBooth (talk) 17:33, 8 February 2012 (UTC)
replies: text: I'm notably younger than DBooth, but I've worked with programming in several companies, and they made the same distinction.  The course I teach also makes that distinction.  I tell students that both "formal parameter / actual parameter" and "parameter / argument" are used, which has been my experience.  I prefer "parameter / argument" because it's far simpler, and "actual parameter" is a bit silly sounding when you're referring to something that may be passed in by copy (in which the "actual parameter" is not what is accessed inside the method).  But people do use that terminology, yes. TricksterWolf (talk) 01:28, 26 February 2012 (UTC)
thread_title:  Argument vs. Parameter 

message: Sources for any of this material?  —Preceding unsigned comment added by 65.209.67.124 (talk) 01:58, 6 February 2008 (UTC)
thread_title:  Sources 

message: Parameter and argument are considered as same in this article. It's wrong and sloppy. Arguments are values binded to the parameters. For example in function definition define max(a,b) : if a < b then b else a; has two parameters, a and b. When we make a function call max(1,2), the numbers 1 and 2 are function arguments. This is common use of these terms in computer sciense/engineering. Somehow wikipedia has mixed these two together. Please correct this.
:I made quite a lot of changes to address this. Should be clear now. --Alan 23:18, 18 January 2006 (UTC)
replies: text: Looks good, though there was a bit of confusion reintroduced regarding call-by-name/call-by-value (which are actually orthogonal to calling conventions -- an evaluation strategy for parameter passing is a property of the language, whereas a calling convention is a property of a particular compiler, platform, and/or build).  --bmills 02:40, 19 January 2006 (UTC)

text: I've been a PhD computer scientist for over 20 years, and I'm also an amateur stickler about English word usage.  I have never seen the rigid distinction between "parameter" and "argument" that this article attempts to make.  On the contrary, the terms "formal parameter" and "actual parameter" are well established terms in computer science and have been for decades, thus clearly suggesting that a "parameter" is not necessarily only a formal parameter.  You may personally believe that this distinction should be made, but it does not reflect the long-established usage of these terms in the field of computer science.  Please feel free to lobby for such usage on your own blog, but this article needs to be re-written to reflect the actual, long-established use of these terms, which does not' make such a distinction.   -- DBooth (talk) 17:17, 8 February 2012 (UTC)

text: For example, see Formal and Actual Arguments  -- DBooth (talk) 17:33, 8 February 2012 (UTC)
thread_title:  Error 

message: What is the difference between call-by-result and call-by-copy-restore? They seem to be defined identically. Derrick Coetzee 20:53, 6 Oct 2004 (UTC)
thread_title:  call-by 

message: What do you mean by in parameter and out parameter? Does in parameter means call by value and out parameter means call by reference? This is respect to C programming language. (TC).
Bold text
Strike-through text
Note: the above comment was added 2006 October 18 by Rsb161702, in this edit; this is the user’s only contribution (as of this writing). The revision of the page at that time (this edit) did not mention “in parameter” or “out parameter”; I believe the original poster was asking for clarification on these. As of this edit and earlier ones, I have added a section on Output parameters (more abstractly, “parameter modes”), which explains these. The original poster also expressed the common confounding of these with call by value and call by reference; I have explained (with references) that these are not the same (as discussed in Ada ’83 Rationale), and may even be backwards (as in PL/SQL)!
To answer the original question: C has no built-in notion of in parameter and out parameter, but the same effect as output and input/output parameters is very commonly used in C by passing pointers to functions and modifying the value that they point at, and one calls these “input parameters” and “output parameters” based on how they are used, though there is no specific language support for them. C is call by value, but this value may be a pointer, which allows one to get the same effects as call by reference, though with different syntax. One can get the effect of an input/output variable by passing a pointer to C function and then reading or modifying the value that it points at. Many other languages do have built-in notions of input parameters and output parameters. Hope this helps future readers!
:—Nils von Barth (nbarth) (talk) 11:11, 5 October 2013 (UTC)
thread_title:  In Parameters and Out Parameters. 

message: The article says
"At runtime, the values assigned to these variables are passed to the subroutine sum. In the sum subroutine, the parameters addend1 and addend2 are evaluated, yielding the arguments 40 and 2, respectively. The values of the arguments are added, and the result is returned to the caller, where it is assigned to the variable sumValue."
Am I the only one who thinks this might make someone believe that the C programming language uses lazy evaluation? Could we somehow make clear that the values for parameters 'addend1 and 'addend2' aren't evaluated in the subroutine? That the values are in fact evaluated before the subroutine call, and the only 'evaluation' of the parameters that happens in the actual subroutine is trivial? 
--Avl (talk) 11:31, 5 October 2008 (UTC)
thread_title:  unclear wording 

message: What is with the obsession with PowerShell?  It seems out of place, given that PowerShell originated none of these technologies. Superm401 - Talk 00:33, 28 November 2008 (UTC)
thread_title:  PowerShell 

message: The place I teach uses the term "distinguished" argument or parameter to refer to the object off of which an instance method is invoked.  Is there another more common name for this?
A quick search of relevant pages turned up no common definition for the distinguished argument (the invoking object) or the distinguished parameter (e.g., "this" in Java).  TricksterWolf (talk) 01:32, 26 February 2012 (UTC)
thread_title:  "Distinguished" Argument and Parameter? 

message: This article makes a big deal about the distinction between the terms argument vs. parameter, but I asked several career programmers and computer scientists, and none are used to making this distinction in practice, and in looking at a variety of programming and computer science books, the names argument and parameter are often used interchangeably (other sources just pick one or the other). I’m sure there are sources that make a careful distinction between "formal parameter" vs. "actual argument" or whatever, but in a quick search I can't find any sources which shorten these separate things to just "parameter" vs. "argument", which seems likely to lead to confusion since the two are routinely conflated and given one name or the other.
If there is no survey of reasonably definitive sources backing up the claims of this article, I would recommend rewriting the lead section to make it clear that these terms are widely used interchangeably, and where a distinction is made, the terminology is often source-specific.
The article is also long and rambling with quite a bit that seems off topic or out of scope. –jacobolus (t) 18:44, 23 October 2022 (UTC)
thread_title:  Distinction between "argument" vs. "parameter" does not reflect real-world usage