In a project, I've found a code like this:
class SomeClass
{
private SomeType _someField;
public SomeType SomeField
{
get { return _someField; }
set { _someField = value; }
}
protected virtual void SomeMethod(/*...., */SomeType someVar)
{
}
private void SomeAnotherMethod()
{
//.............
SomeMethod(_someField);
//.............
}
};
How better todo I convince my teammates that this code is bad code?
UPD At leastI believe this is an unnecessary complication. Why Why pass a member variable as a method parameter, if you already hashave access to it? This This is also a violation of encapsulation, as well.
Any
Do you see any other considerationsissues with this code?