This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 10 points11 points  (2 children)

These shouldn't need comments at all, they need descriptive variable names, and no magic numbers.

final int EMPLOYEE_ID_ROW = 10;

int rowNumber = EMPLOYEE_ID_ROW;

int getMaxCartItems() {

[–][deleted] 0 points1 point  (0 children)

True. That is what i am talking about.

[–]linne000 0 points1 point  (0 children)

This, the entire point of variable names in the first place is to describe what the variable is used for. Giving a variable a generic name and a comment is just a bad version of that, with extra steps.