Given the following methods:
public int methodOne() {
int total = local_int_one + local_int_two;
return total;
}
public int methodTwo() {
return local_int_one + local_int_two;
}
1) Is the only difference in the above methods readability or is there a micro-optimization "benefit" in methodTwo()?
2) Should the defining of local variables in a narrow scope be shunned and avoided when possible? (I can see methodTwo becoming unreadable if several calculations must be performed in a single statement)