csharpstandard icon indicating copy to clipboard operation
csharpstandard copied to clipboard

Parameters #2: Alternate Terms for a Parameter Kind

Open RexJaeschke opened this issue 1 year ago • 3 comments

Recently, I had cause to review the spec in terms of function parameters, and argument passing. [This was regarding adding future support for ref readonly parameters.] I found a lot of places where the text could be considerably simplified, made consistent, or have duplication of normative text removed. This issue deals with one aspect, and is not intended to result in any semantic changes. Rather, it is intended to create a better base on which to add future feature specs. Hopefully, we can decide offline on each proposal without taking up TG2 meeting time.

Issue

Variables.md, 9.2.8 Input parameters, states

A parameter declared with an in modifier is an input parameter.

So, the term “input parameter” is defined (and matches the parent section name). However, while 61 occurrences of text about input parameters uses that term, 33 occurrences use “in parameter” instead, for no obvious reason and with no value added.

The same situation exists for “output/out parameter” (9.2.7 Output parameters) and “reference/ref parameter” (9.2.6 Reference parameters).

[There is no such duplication for “value parameter.” 9.2.5 Value parameters states: “A parameter declared without an in, out, or ref modifier is a value parameter, and “value parameter” is used throughout.]

Proposal

  • Change all “in parameter” to “input parameter.”
  • Change all “out parameter” to “output parameter.”
  • Change all “ref parameter” to “reference parameter.”
  • Also, change such text not having the backticks, as in “out parameter.”
  • Change the term definition “by-reference parameter” to “by-reference parameter.”
  • Change all enumerated lists “input, output, and/or reference parameter” to the corresponding group term “by-reference parameter.”

Discussion

The term “by-reference parameters” is defined in 15.6.2.3.1 General and only referenced in Clause 15. It’s simply used to organize related subclauses as a group, so let’s use it instead of an enumerated list of its members.

RexJaeschke avatar Aug 15 '24 20:08 RexJaeschke

@jskeet If you can add a thumbs-up to Nigel's, I'll make the changes.

RexJaeschke avatar Aug 30 '24 15:08 RexJaeschke

Yes, this definitely seems sensible to me.

jskeet avatar Aug 30 '24 15:08 jskeet

On the 2024-09-04 TG2 call we agreed with Rex's proposal. Rex will create a PR for this.

RexJaeschke avatar Sep 05 '24 13:09 RexJaeschke