In my naming convention, I use _name for private member variables. I noticed that if I auto-generate a constructor with ReSharper, if the member is a keyword, it will generate an escaped keyword. For example:
class IntrinsicFunctionCall
{
private Parameter[] _params;
public IntrinsicFunctionCall(Parameter[] @params)
{
_params = @params;
}
}
Is this generally considered bad practice or is it OK? It happens quite frequently with @params and @interface.
EDIT: This doesn't actually add a prefix to the variable name. If accessing that variable from a different .NET language, i.e. F#, it would just be params
. In fact, in C#, if you write @x
it's exactly equivalent to x
.