In my naming convention, I use _name for private member variables. I noticed that if I automatically create a constructor with ReSharper, if the member is a keyword, it will generate the escaped keyword. For instance:
class IntrinsicFunctionCall
{
private Parameter[] _params;
public IntrinsicFunctionCall(Parameter[] @params)
{
_params = @params;
}
}
Is this generally bad practice or is everything okay? This happens quite often with @params and @interface.
EDIT: this does not actually add a prefix to the variable name. If accessing this variable is from another .NET language, that is, F #, it will be simple params. In fact, in C #, if you write @x, it is exactly equivalent x.
source
share