2

What is the common way of naming parameters in a method like the following?

void MyMethod(int[] series1, int[] series2) { ... }

The two arrays there have the same purpose, maybe the method takes two arrays of names, or two series, or something similar. What is a common way to name such parameters? Would you use parameter1, parameter2, ... or firstParameter, secondParameter, ... or something else?

I would appreciate if you could give me an example of such a method in the .NET Framework itself.

4

2 回答 2

2

这里有一些例子:

我不认为有一个在整个 .NET 框架中始终如一地使用的约定。
方法名称清楚地说明了参数的含义。

于 2013-02-21T21:52:52.567 回答
1

The way you have done it is common.

However, if the method reflects a documented algorithm, then using names that match that algorithm is better.

于 2013-02-21T21:49:20.717 回答