P
Patrick
The c# code style guide that I follow suggests that class variables (fields)
be coded with camel casing, like this:
int recordId;
string name;
It also suggests that variables within methods and method parameters use
camel casing, like this:
void SetName(int id, string newName)
{
recordId = id;
name = newName;
return;
}
This is all fine and dandy, but some of my methods are getting a bit
difficult to read. It's hard to differentiate between class fields (that
have a class-wide scope) and method variables (that have a method-wide
scope). I've started to use the "this" keyword with class variables,
example:
void SetName(int recordId, string name)
{
this.recordId = recordId;
this.name = name;
}
BUT, when you do that, you start to get really long lines of code. Here's a
real line of my code that exhibits this problem:
this.currencyManager = (CurrencyManager)
this.grdPerson.BindingContext[this.dataView];
I'd love to know what other c# developers do.
Thanks!
Patrick
be coded with camel casing, like this:
int recordId;
string name;
It also suggests that variables within methods and method parameters use
camel casing, like this:
void SetName(int id, string newName)
{
recordId = id;
name = newName;
return;
}
This is all fine and dandy, but some of my methods are getting a bit
difficult to read. It's hard to differentiate between class fields (that
have a class-wide scope) and method variables (that have a method-wide
scope). I've started to use the "this" keyword with class variables,
example:
void SetName(int recordId, string name)
{
this.recordId = recordId;
this.name = name;
}
BUT, when you do that, you start to get really long lines of code. Here's a
real line of my code that exhibits this problem:
this.currencyManager = (CurrencyManager)
this.grdPerson.BindingContext[this.dataView];
I'd love to know what other c# developers do.
Thanks!
Patrick