Java Variable Naming

I am not sure if this is the best practice for naming variables but I find the codes easier to read this way. Append the letter 'a' to every Class variables, 'p' to method/Constructor parameter, and 'l' to local variables .

If you do this I'm sure the guy who will maintain your code will not have a hard time debugging your code.

Class Animal {
private String aAnimalType;
public void setAnimalType(String pAnimalType){
aAnimalType = aAnimalType;
}
public String getAnimalType(){
return aAnimalType;
}
}


About this entry


0 comments: