Here is a little problem I've run into, and none of the naming
conventions have helped... Ever since I switched from C to C# and
FxCop, I've going crazy trying to fix some style issues.
I have 3 major issues...
---------
Let's say I have a class called Parameter.
In another class, I want to define a method taking a Parameter.
public void Foo(Parameter ???) {}
The problem is, I'm getting writer's block trying to come up with what
to call the passed variable!
Here's a poor style solution - you have a variable that's one case off
from the class:
public void Foo(Parameter parameter) {}
Here's another poor style solution - you have a variable that's an
abbreviation, and FxCop hates that:
public void Foo(Parameter param) {}
So... What do I call it? Are there generic names that people typically
use, such as "item" or "value"? Are there lists of generic names out
there?
---------
On a similar note... Let's say I have a constructor and a property...
private string _name;
public string Name {get {return _name;} set{_name = value;}}
public Foo(string name)
{
Name = name;
}
I know this is bad form because you have a single case difference, but
I can't always think of a better way of naming things. What can I do?
---------
Finally...
public void IsValidString(string ???)
I want to run a test on a string... What is a good name to call the
passed variable? "testString" won't work, because that's a holdover to
Hungarian notation. "test" sounds too banal... Any suggestions?
---------
Please help me with my style!
- Phillip