To prevent silly mistakes like if (j = 10) I usually write if (10 == j) By putting the constant first, I ensure that the compiler will catch the typo.