7

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?

6
  • 2
    possible duplicate of "Parameter" vs "Argument"
    – GSerg
    Sep 11, 2015 at 10:14
  • possible duplicate of Difference between parameter and argument
    – GSerg
    Sep 11, 2015 at 10:16
  • 1
    If you are starting with VB.NET, you should better focus on actually using the language and not worrying so much about designations.
    – user2480047
    Sep 11, 2015 at 10:38
  • @GSerg I have added an explanation of why it is not a duplicate. Sep 11, 2015 at 11:18
  • 1
    @varocarbas This is the second time I am teaching this course, so I am pretty comfortable with the language. I just want to make sure that I use correct terminology when teaching it. Sep 11, 2015 at 11:19

1 Answer 1

4
  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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.