Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting the terminology straight: operands, parameters and arguments

Please note that this question is not a duplicate of this or this, since the other questions do not have the operator component and do not ask about the details of parameters and arguments that I am asking about.

I am going to teach a first programming course using vb.net. Please note that this course will cover only procedural programming (with the focus on algorithmic thinking) and will not mention OOP, so no operator overloading.

I am seeking help in getting the terminology straight:

  1. Is the following statement correct: a procedure can have parameters. If a procedure has parameters, then it accepts arguments?

  2. Does the term parameter refer only to procedures or also to operators? That is, can I say that a binary operator has two parameters even when talking about built-in types (such as Integer)?

  3. Is it wrong to say that an operator has operands? (just like it is wrong to say that a procedure has arguments)

  4. Is the usage of two different terms -- argument and operand -- for procedures and operators, respectively, explained only by historical reasons or there is a fundamental difference between the two concepts?

  5. Does a parameter of a procedure include the parameter's name? I think that in C++ (with the question asked about functions' parameters) the answer is "No"; what is it in vb.net?

like image 983
AlwaysLearning Avatar asked Oct 20 '22 02:10

AlwaysLearning


1 Answers

  1. Yes. When procedure is called, it receives arguments.

  2. If you are looking at operator signature like +(a As Integer, b As Integer), parameters term is adequate in the context. If you are analyzing its execution then in 2 + 3 you have operands and when looking into operator method body, you just received arguments. So look into context.

  3. Answered above.

  4. Should be clear now. Operands are part of high-level view on operator. If analyzing expression tree, you can speak about operators and their operands. But if technically analyzing procedure for given operator, you go with parameters and arguments.

  5. It does not. However, you can get to names using NameOf() operator or through the Reflection.

like image 148
miroxlav Avatar answered Oct 22 '22 22:10

miroxlav