Talk:Parameter (computer programming)
Argument vs. Parameter
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)
Sources
Sources for any of this material? —Preceding unsigned comment added by 65.209.67.124 (talk) 01:58, 6 February 2008 (UTC)
Error
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)
- 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)
call-by
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)
call-by-result is call-by-copy-restore with an uninitialzed variable. There are some factual errors in the "calling conventions" section of this article, which will hopefully be corrected in the migration to evaluation strategy. --bmills 21:09, 23 October 2005 (UTC)
Cleanup
This article is not very encyclopedic. It would be great for a programming tutorial, but not for an encyclopedia. – flamurai (t) 02:52, Feb 12, 2005 (UTC)
- I'm working on a cleanup and rewrite this week. I'm going to move a cleaned-up version of the "calling conventions" (which are really evaluation strategies) into a forthcoming article I've stubbed (evaluation strategy); I think the rest of the article is pretty much redundant with subroutine (which is much larger and therefore likely to be better maintained), so I'm going to recommend that the rest of the article be dropped and redirected to subroutine. --bmills 07:10, 23 October 2005 (UTC)
I rewrote the article somewhat. I removed the {{mergeto}} notice based on the number of individual articles that could be considered sub-articles of this, or that could be merged into this. They include function argument (I just merged it to here), default argument, and named parameter. There are also four foreign-language pages for this specific article. I also moved the overloading section to subroutine, as, IMHO, it doesn't have anything to do with specific arguments per-se, as in strongly-typed languages, it's implemented by creating a second copy of the subroutine. --Interiot 21:29, 10 November 2005 (UTC)
- Looks like a positive change — the article as now phrased is surprisingly not redundant with subroutine, and the level of quality is much higher! --bmills 19:54, 12 November 2005 (UTC)
It might be worth pointing out that in some languages (C++ at least), in formal usage, there's a distinction between the meaning of 'argument' and 'parameter', as per [1]. --samdutton 08:30, 21 December 2005 (UTC)
- These are covered somewhat at Parameter#Computer_science in case anyone wants to incorporate some of that text here. I don't quite grok the distinction myself though. Is it just like the difference between a function prototype, and instances of calling a function? Or is there more to it than that?
- Also, regarding things like Macro#Macro_languages... it would be nice if someone who is an expert in functional languages could expand the article to include some of the formal concepts from functional programming. --Interiot 18:22, 21 December 2005 (UTC)
In Parameters and Out Parameters.
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
unclear wording
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)
PowerShell
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)