If a private
field is declared but not used in the program, it can be considered dead code and should therefore be removed. This will
improve maintainability because developers will not wonder what the variable is used for.
Noncompliant Code Example
public class MyClass {
private var foo:int = 4; //foo is unused
public function compute(a:int):int{
return a * 4;
}
}
Compliant Solution
public class MyClass {
public function compute(a:int):int{
return a * 4;
}
}