What are the Java conventions on primitive types? Should I be documenting each primitive type if I name it properly?
/**
* This is the variable that handles whether or not a person has turned on a light.
*/
private boolean toggleLight = false;
That just seems to me like it’s absolute overkill, if anyone has a source or just plain previous knowledge then that would be greatly appreciated.
I think more than anything it depends on the team you are working in, different companies and even projects have different “standards”. I personally don’t bother to comment every variable, especially as variables tend to be private. If a variable is public then I will comment it so it appears in my Javadoc.
Same goes for methods, if it’s a private method I don’t bother commenting if it’s obvious, I also don’t comment setters and getters, only methods with logic in.
As I said though, it generally depends on the team within which you are coding.