they look like really good pref and I did change mine to them but I don't understand why prefix with the letter a?
spychic101 3 weeks ago
@spychic101 Some try to avoid parameter shadowing. In other words if you have a class instance variable
int bank in a setBank method should you have
public void setBank(int bank) { this.bank = bank;
}
or would it be better to have
public void setBank(int aBank) { bank = aBank;
One school of thought is the later is better for maintenance as you would not make the mistake of
public void setBank(int bank) { bank = bank;
ElonCsProf 2 weeks ago
they look like really good pref and I did change mine to them but I don't understand why prefix with the letter a?
spychic101 3 weeks ago
@spychic101 Some try to avoid parameter shadowing. In other words if you have a class instance variable
int bank in a setBank method should you have
public void setBank(int bank) { this.bank = bank;
}
or would it be better to have
public void setBank(int aBank) { bank = aBank;
}
One school of thought is the later is better for maintenance as you would not make the mistake of
public void setBank(int bank) { bank = bank;
}
ElonCsProf 2 weeks ago