参数和参数有什么区别? [英] What's the difference between an argument and a parameter?
问题描述
当口头谈论方法时,我永远不确定是使用参数还是参数或其他词.无论哪种方式,其他人都知道我的意思,但什么是正确的,这些术语的历史是什么?
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 I mean, but what's correct, and what's the history of the terms?
我是一名 C# 程序员,但我也想知道人们是否在不同的语言中使用不同的术语.
I'm a C# programmer, but I also wonder whether people use different terms in different languages.
为了记录,我是自学的,没有计算机科学背景.(请不要告诉我阅读代码完整 因为我是为了其他还没有史蒂夫·麦康奈尔 了不起的书.)
For the record I'm self-taught without a background in Computer Science. (Please don't tell me to read Code Complete because I'm asking this for the benefit of other people who don't already have a copy of Steve McConnell's marvellous book.)
普遍的共识似乎是在团队环境中可以互换使用这些术语.除非您正在定义精确的术语;那么你也可以使用形式参数/参数"和实际参数/参数"来消除歧义.
The general consensus seems to be that it's OK to use these terms interchangeably in a team environment. Except perhaps when you're defining the precise terminology; then you can also use "formal argument/parameter" and "actual argument/parameter" to disambiguate.
推荐答案
简单:
- PARAMETER → PLACEHOLDER(这意味着占位符属于函数命名并在函数体中使用)
- ARGUMENT → ACTUAL VALUE(这意味着函数调用传递的实际值)
- PARAMETER → PLACEHOLDER (This means a placeholder belongs to the function naming and be used in the function body)
- ARGUMENT → ACTUAL VALUE (This means an actual value which is passed by the function calling)
这篇关于参数和参数有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!