Private fields only used to store values without reading them later is a case of dead store. So changing the value of such field is useless and most probably indicates a serious error in the code.
public class Rectangle
{
private readonly int length;
private readonly int width; // width is written but never read
public Rectangle(int length, int width)
{
this.length = length;
this.width = width;
}
public int Surface
{
get
{
return length * length;
}
}
}
public class Rectangle
{
private readonly int length;
private readonly int width;
public Rectangle(int length, int width)
{
this.length = length;
this.width= width;
}
public int Surface
{
get
{
return length * width;
}
}
}